fix of process handling with "choice"
This commit is contained in:
parent
ab45d164e7
commit
17a52a46dc
|
@ -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' %}
|
||||
|
|
|
@ -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,}
|
||||
|
|
Loading…
Reference in New Issue