diff --git a/austritt/views.py b/austritt/views.py index 3412fc0..9d19209 100644 --- a/austritt/views.py +++ b/austritt/views.py @@ -162,7 +162,7 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): return HttpResponseRedirect('success') - def send_mail_to_department(self, department, pdf=None): + def send_mail_to_department(self, department): 'send a mail to the given department with the nececcary notifications' print(f'send mail to department {department}...') @@ -180,7 +180,7 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): #hardcoded imagepath => change for production!!! context_pdf ={ 'pdf_data': pdf_data, - 'image_path': '/srv/austritt/static/evapp/logo.png' + 'image_path': '/srv/eva/austritt/static/evapp/logo.png' } html_string =render_to_string('austritt/pdf_template.html', context_pdf, request=self.request) buffer=io.BytesIO() @@ -203,9 +203,9 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): elif department != "SUBMITTER": # comment this back in if you wanna run mail attachments - if pdf and department == "OFFICE": + if pdf_bytes and department == "OFFICE": mail= EmailMessage( - subject=f'EVA: Austritt {firstname} {lastname} {lastday} (MAILTEST)', + subject=f'EVA: Austritt {firstname} {lastname} {lastday}', body=mail_template.render(context), from_email=EVA_MAIL, to=[EVA_MAIL],