[PATCH 05 of 54] Add support for writing incomplete documents

Wald Commits scm-commit at wald.intevation.org
Wed Jan 7 10:56:22 CET 2015


# HG changeset patch
# User Benoît Allard <benoit.allard at greenbone.net>
# Date 1412587469 -7200
# Node ID c5cf387b57857dc7fdc41cd94afd0ff83d0ba7dc
# Parent  5d81cea79583fbf2928b442d3defa3ae0b2b221f
Add support for writing incomplete documents

diff -r 5d81cea79583 -r c5cf387b5785 farolluz/templates/cvrf.j2
--- a/farolluz/templates/cvrf.j2	Wed Sep 24 17:32:31 2014 +0200
+++ b/farolluz/templates/cvrf.j2	Mon Oct 06 11:24:29 2014 +0200
@@ -44,7 +44,7 @@
 <cvrfdoc xmlns="http://www.icasi.org/CVRF/schema/cvrf/1.1">
   <DocumentTitle>{{ cvrf._title }}</DocumentTitle>
   <DocumentType>{{ cvrf._type }}</DocumentType>
-  {%- with publisher = cvrf._publisher %}
+  {%- with publisher = cvrf._publisher %}{% if publisher %}
   <DocumentPublisher{{ {'Type': publisher._type, 'VendorID': publisher._vendorid} | xmlattr }}>
     {%- if publisher._contact %}
     <ContactDetails>{{ publisher._contact }}</ContactDetails>
@@ -53,8 +53,8 @@
     <IssuingAuthority>{{ publisher._authority }}</IssuingAuthority>
     {%- endif %}
   </DocumentPublisher>
-  {%- endwith %}
-  {%- with tracking = cvrf._tracking %}
+  {%- endif %}{% endwith %}
+  {%- with tracking = cvrf._tracking %}{% if tracking %}
   <DocumentTracking>
     <Identification>
       <ID>{{ tracking._identification._id }}</ID>
@@ -88,7 +88,7 @@
     </Generator>
     {%- endif %}
   </DocumentTracking>
-  {%- endwith %}
+  {%- endif %}{% endwith %}
   {%- if cvrf._notes %}
   <DocumentNotes>
     {%- for note in cvrf._notes %}


More information about the Farol-commits mailing list