fixed form view for step 4
This commit is contained in:
parent
b4512a2739
commit
78539cb582
|
|
@ -50,15 +50,6 @@
|
|||
{% translate "IT-relevante Angaben" %}
|
||||
{% elif wizard.steps.step1 == 4 %}
|
||||
{% translate "Sonstige Angaben" %}
|
||||
<!-- Delete when in production!! -->
|
||||
<!--{% elif wizard.steps.step1 == 5 %}
|
||||
{% translate "PDF Abgabe Arbeitsmittel" %}
|
||||
{% if pdf_data %}
|
||||
{% include 'austritt/pdf_template.html' %}
|
||||
<a href="{% url 'pdf-preview' %}" target="_blank">
|
||||
<button type="button">Als PDF speichern</button>
|
||||
</a>
|
||||
{% endif %}-->
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ def beautify_data_pdf(data):
|
|||
|
||||
class EvaFormView(LoginRequiredMixin, CookieWizardView):
|
||||
template_name = 'austritt/employee_form.html'
|
||||
form_list = [PersonalForm, HRForm, ITForm, RestForm, DummyForm, DummyForm, DummyForm]
|
||||
form_list = [PersonalForm, HRForm, ITForm, RestForm, DummyForm, DummyForm]
|
||||
instance = None
|
||||
choice = 'IN'
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
|
|||
|
||||
# six steps for testing purposes ONLY!!
|
||||
# deliver context for forms if we are in the last step
|
||||
if (self.steps.step1 == 6 or (self.choice != 'IN' and self.steps.step1 == 6)):
|
||||
if (self.steps.step1 == 5 or (self.choice != 'IN' and self.steps.step1 == 5)):
|
||||
context.update({'data': self.beautify_data(self.get_all_cleaned_data()),
|
||||
'datatable': 1,})
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
|
|||
#hardcoded imagepath => change for production!!!
|
||||
context_pdf ={
|
||||
'pdf_data': pdf_data,
|
||||
'image_path': '/path/to/your/eva/austritt/static/evapp/logo.png'
|
||||
'image_path': '/srv/austritt/static/evapp/logo.png'
|
||||
}
|
||||
html_string =render_to_string('austritt/pdf_template.html', context_pdf, request=self.request)
|
||||
buffer=io.BytesIO()
|
||||
|
|
@ -203,7 +203,7 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
|
|||
elif department != "SUBMITTER":
|
||||
|
||||
# comment this back in if you wanna run mail attachments
|
||||
'''if pdf and department == "OFFICE":
|
||||
if pdf and department == "OFFICE":
|
||||
mail= EmailMessage(
|
||||
subject=f'EVA: Austritt {firstname} {lastname} {lastday} (MAILTEST)',
|
||||
body=mail_template.render(context),
|
||||
|
|
@ -213,7 +213,6 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
|
|||
mail.attach(f'Rueckgabe_Arbeitsmittel_{firstname}_{lastname}.pdf', pdf_bytes, 'application/pdf')
|
||||
mail.send(fail_silently=False)
|
||||
else:
|
||||
'''
|
||||
send_mail(
|
||||
f'EVA: Austritt {firstname} {lastname} {lastday}',
|
||||
mail_template.render(context),
|
||||
|
|
|
|||
Loading…
Reference in New Issue