Commit 45b44506 authored by LammLukas's avatar LammLukas
Browse files

Changes make_docx_protocol in to find templates on win and linux

parent 36195f12
......@@ -5,7 +5,7 @@ Author: L. Lamm (
from src.exceptions import *
from docxtpl import DocxTemplate
import re
import os, re
class Protocol:
......@@ -24,7 +24,8 @@ class Protocol:
def make_docx_protocol(self, file, lang):
"""Export docx protocol from template"""
if lang == 'german':
template_file = "./templates/protocols/protocol_german_written.docx"
basedir = os.path.dirname(os.path.dirname(__file__))
template_file = os.path.join(basedir, r'templates', r'protocols', r'protocol_german_written.docx')
raise ProtocolTemplateDoesNotExist()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment