Parcourir la source

Fixed the reportDescription templates

Stan Janssen il y a 4 ans
Parent
commit
e4e3a7bf2e

+ 1 - 1
pyopenadr/templates/oadrRegisterReport.xml

@@ -16,7 +16,7 @@
         </xcal:duration>
         {% endif %}
         <ei:eiReportID>{{ report.report_id }}</ei:eiReportID>
-    {% for r_id, report_description in report.report_descriptions.items() %}
+    {% for report_description in report.report_descriptions %}
         {% include 'parts/oadrReportDescription.xml' %}
     {% endfor %}
         <ei:reportRequestID>{{ report.report_request_id }}</ei:reportRequestID>

+ 1 - 1
pyopenadr/templates/oadrUpdateReport.xml

@@ -8,7 +8,7 @@
       <oadrReport>
         <ei:eiReportID>{{ report.report_id }}</ei:eiReportID>
         {% if report.report_descriptions %}
-        {% for r_id, report_description in report.report_descriptions.items() %}
+        {% for report_description in report.report_descriptions %}
         {% include 'parts/oadrReportDescription.xml' %}
         <ei:reportRequestID>{{ report.report_request_id }}</ei:reportRequestID>
         <ei:reportSpecifierID>{{ report.report_specifier_id }}</ei:reportSpecifierID>

+ 1 - 1
pyopenadr/templates/parts/oadrReportDescription.xml

@@ -1,5 +1,5 @@
 <oadrReportDescription xmlns:emix="http://docs.oasis-open.org/ns/emix/2011/06">
-  <ei:rID>{{ r_id }}</ei:rID>
+  <ei:rID>{{ report_description.r_id }}</ei:rID>
   {% if report_description.report_subjects %}
   <ei:reportSubject>
   {% for target in report_description.report_subjects %}