diff --git a/TODO b/TODO index d3e74b2..2b913ba 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ -- remove empty lines in mail - - in mail ändern "Deine mailadresse" in "ansprechpartner_in" - true/false übersetzen in dataloop diff --git a/evapp/templates/evapp/dataloop.txt b/evapp/templates/evapp/dataloop.txt index a0b1b94..b4c89a5 100644 --- a/evapp/templates/evapp/dataloop.txt +++ b/evapp/templates/evapp/dataloop.txt @@ -1,9 +1,4 @@ {% autoescape off %} -{% for key, value in data.items %} - {% if key == 'laptop' %} - {{ key }}: {{ value | safe}} - {% else %} - {{ key }}: {{ value }} - {% endif %} -{% endfor %} +{% for key, value in data.items %}{% if key == 'laptop' %} {{ key }}: {{ value | safe}}{% else %} +{{ key }}: {{ value }}{% endif %}{% endfor %} {% endautoescape %} diff --git a/evapp/views.py b/evapp/views.py index 82bd80e..4c857cb 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -178,7 +178,10 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): data['accounts'] = [ACCOUNT_CHOICES[c] for c in data['accounts']] # replace keys in data dictionary with verbose_name - mail = data.pop('email') + mail = '' + if 'email' in data: + mail = data.pop('email') newdata = {self.instance._meta.get_field(k).verbose_name.title() : v for k,v in data.items()} - newdata['email'] = mail + if mail: + newdata['email'] = mail return newdata