Browse Source

Make Request object optional in oadrDistributeEvent

Stan Janssen 4 years ago
parent
commit
b12691aaca
1 changed files with 2 additions and 0 deletions
  1. 2 0
      openleadr/templates/oadrDistributeEvent.xml

+ 2 - 0
openleadr/templates/oadrDistributeEvent.xml

@@ -1,10 +1,12 @@
 <oadrSignedObject xmlns="http://openadr.org/oadr-2.0b/2012/07" id="oadrSignedObject">
 <oadrSignedObject xmlns="http://openadr.org/oadr-2.0b/2012/07" id="oadrSignedObject">
   <oadrDistributeEvent ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
   <oadrDistributeEvent ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
+    {% if response %}
     <ei:eiResponse>
     <ei:eiResponse>
       <ei:responseCode>{{ response.response_code }}</ei:responseCode>
       <ei:responseCode>{{ response.response_code }}</ei:responseCode>
       <ei:responseDescription>{{ response.response_description }}</ei:responseDescription>
       <ei:responseDescription>{{ response.response_description }}</ei:responseDescription>
       <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ response.request_id }}</requestID>
       <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ response.request_id }}</requestID>
     </ei:eiResponse>
     </ei:eiResponse>
+    {% endif %}
     <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
     <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
     <ei:vtnID>{{ vtn_id }}</ei:vtnID>
     <ei:vtnID>{{ vtn_id }}</ei:vtnID>
     {% for event in events %}
     {% for event in events %}