From 7373a3cc473bd29413125554f92f5b8357e7d910 Mon Sep 17 00:00:00 2001
From: "DASTUD\\sup-imcovangent" <i.vangent@tudelft.nl>
Date: Wed, 10 Oct 2018 11:01:18 +0200
Subject: [PATCH] Bug fix for cmdows_template.xml file path issue.

Former-commit-id: 844fedd1396806f1387ca2d2c28c097f13678717
---
 kadmos/vistoms/vistoms.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kadmos/vistoms/vistoms.py b/kadmos/vistoms/vistoms.py
index 8a4ac84a7..dda87a004 100644
--- a/kadmos/vistoms/vistoms.py
+++ b/kadmos/vistoms/vistoms.py
@@ -1159,7 +1159,7 @@ def interface(debug=True, tempdir=None):
 
                 # Here the dc cmdows file is loaded
                 # Save the template cmdows file in the tmp folder
-                cmdows_template = os.path.join('templates', 'cmdows_template.xml')
+                cmdows_template = os.path.join(os.path.split(__file__)[0], 'templates', 'cmdows_template.xml')
                 cmdows_file = os.path.join(session_folder, 'cmdows_template.xml')
                 # Write the new competence to the CMDOWS template xml file
                 tree = ET.parse(cmdows_template)
@@ -1206,7 +1206,7 @@ def interface(debug=True, tempdir=None):
                 return newVistomsData
 
         except Exception as e:
-            return "ERROR: " + e.message
+            return "ERROR: {}".format(e)
             # Logs the error appropriately.
 
     @app.route('/kadmos_edit_contact_infos', methods=['POST'])
-- 
GitLab