From 2cba9975069009a95d7e735249fb2f4af6e0420f Mon Sep 17 00:00:00 2001
From: Rolf Niepraschk <Rolf.Niepraschk@ptb.de>
Date: Tue, 1 Dec 2020 10:30:57 +0100
Subject: [PATCH] "render_template" inside "try ..."

---
 trans.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/trans.py b/trans.py
index e0ddd86..62e5e7c 100644
--- a/trans.py
+++ b/trans.py
@@ -20,10 +20,10 @@ def cert_to_xml(cert_doc):
       'release':version \
     }
     cert_doc['DCC']['administrativeData']['dccSoftware'].append(s)
-           
-    xml = render_template(dcc_template, doc=cert_doc['DCC'], utils=utils)  
-    try:
+    try: 
+        xml = render_template(dcc_template, doc=cert_doc['DCC'], utils=utils) 
         xml = etree.canonicalize(prettify_xml(xml, indent=2, debug=False))
+        
     except Exception as error:
         xml = '<error>' + str(error) + '</error>\n'
     
-- 
GitLab