WMDE
/
eva
geforkt von tohe/eva
7
1
Fork 0

removed "None" and "[]" from last step and mails

Dieser Commit ist enthalten in:
Benni Bärmann 2021-05-05 11:11:34 +02:00
Ursprung 707ce532b6
Commit 4251fcbc2c
2 geänderte Dateien mit 6 neuen und 2 gelöschten Zeilen

2
TODO
Datei anzeigen

@ -1 +1 @@
- remove None and [] in the overwiew in last step and in mails

Datei anzeigen

@ -176,6 +176,7 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
data['accounts'] = [ACCOUNT_CHOICES[c] for c in data['accounts']]
# 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 = ''
if 'email' in data:
mail = data.pop('email')
@ -183,8 +184,11 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
if mail:
newdata['Email'] = mail
#translate booleans
# translate booleans
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})
# 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