Compare commits
2 Commits
707ce532b6
...
8bd6f9b34f
Author | SHA1 | Date |
---|---|---|
Benni Bärmann | 8bd6f9b34f | |
Benni Bärmann | 4251fcbc2c |
|
@ -176,6 +176,7 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
|
||||||
data['accounts'] = [ACCOUNT_CHOICES[c] for c in data['accounts']]
|
data['accounts'] = [ACCOUNT_CHOICES[c] for c in data['accounts']]
|
||||||
|
|
||||||
# replace keys in data dictionary with verbose_name
|
# replace keys in data dictionary with verbose_name
|
||||||
|
# a bit ugly workaround here: we need to store 'email' away, because it es not in the modell
|
||||||
mail = ''
|
mail = ''
|
||||||
if 'email' in data:
|
if 'email' in data:
|
||||||
mail = data.pop('email')
|
mail = data.pop('email')
|
||||||
|
@ -186,5 +187,8 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
|
||||||
# translate booleans
|
# translate booleans
|
||||||
newdata.update({k:'Ja' for k,v in newdata.items() if isinstance(v,bool) and v == True})
|
newdata.update({k:'Ja' for k,v in newdata.items() if isinstance(v,bool) and v == True})
|
||||||
newdata.update({k:'Nein' for k,v in newdata.items() if isinstance(v,bool) and v == False})
|
newdata.update({k:'Nein' for k,v in newdata.items() if isinstance(v,bool) and v == False})
|
||||||
|
# handle some special data types
|
||||||
|
newdata.update({k:'' for k,v in newdata.items() if v == None})
|
||||||
|
newdata.update({k:'' for k,v in newdata.items() if v == []})
|
||||||
|
|
||||||
return newdata
|
return newdata
|
||||||
|
|
Loading…
Reference in New Issue