Kaynağa Gözat

Make Request object optional in oadrDistributeEvent

Stan Janssen 4 yıl önce
ebeveyn
işleme
b12691aaca
1 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  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">
   <oadrDistributeEvent ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
+    {% if response %}
     <ei:eiResponse>
       <ei:responseCode>{{ response.response_code }}</ei:responseCode>
       <ei:responseDescription>{{ response.response_description }}</ei:responseDescription>
       <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ response.request_id }}</requestID>
     </ei:eiResponse>
+    {% endif %}
     <requestID xmlns="http://docs.oasis-open.org/ns/energyinterop/201110/payloads">{{ request_id }}</requestID>
     <ei:vtnID>{{ vtn_id }}</ei:vtnID>
     {% for event in events %}