fix of process handling with "choice"

This commit is contained in:
Benni Bärmann 2021-02-04 12:17:05 +01:00
parent ab45d164e7
commit 17a52a46dc
2 changed files with 6 additions and 4 deletions

View File

@ -32,6 +32,7 @@
</h1>
<h2>
<p>Schritt {{ wizard.steps.step1 }} von {{ wizard.steps.count }}</p>
Choice: {{choice}}
<p>{% if wizard.steps.step1 == 1 %}
Angaben zur Person {% endif %}
{% if choice == 'IN' %}

View File

@ -66,10 +66,11 @@ class EvaFormView(CookieWizardView):
# we need this to display all the data in the last step
def get_context_data(self, form, **kwargs):
print('GETCONTEXT')
context = super().get_context_data(form=form, **kwargs)
if (self.steps.current == 5 or self.choice == 'CHANGE'):
context.update({'data': self.beautify_data(self.get_all_cleaned_data()),
'choice' : self.choice})
context.update({'choice': self.choice})
if (self.steps.current == 5 or (self.choice == 'CHANGE' and self.steps.current ==3)):
context.update({'data': self.beautify_data(self.get_all_cleaned_data())})
return context
#this makes shure, that we use the same model instance for all steps
@ -155,7 +156,7 @@ class EvaFormView(CookieWizardView):
# This implementation works only for unique keys over all of these dicts from model.py
#
def beautify_data(self, data):
print("BEAUTIFY")
# update values in data dictionary with keys from *_CHOICES if present there
choices = {**DEPARTMENT_CHOICES, **LAPTOP_CHOICES, **TRANSPONDER_CHOICES,
**OS_CHOICES, **MOBILE_CHOICES, **LANG_CHOICES,}