removed empty lines in mails. bugfix regarding mail generation

This commit is contained in:
Benni Bärmann 2021-05-04 12:16:01 +02:00
parent 334bffdad0
commit 910c24f703
3 changed files with 7 additions and 11 deletions

2
TODO
View File

@ -1,5 +1,3 @@
- remove empty lines in mail
- in mail ändern "Deine mailadresse" in "ansprechpartner_in" - in mail ändern "Deine mailadresse" in "ansprechpartner_in"
- true/false übersetzen in dataloop - true/false übersetzen in dataloop

View File

@ -1,9 +1,4 @@
{% autoescape off %} {% autoescape off %}
{% for key, value in data.items %} {% for key, value in data.items %}{% if key == 'laptop' %} {{ key }}: {{ value | safe}}{% else %}
{% if key == 'laptop' %} {{ key }}: {{ value }}{% endif %}{% endfor %}
{{ key }}: {{ value | safe}}
{% else %}
{{ key }}: {{ value }}
{% endif %}
{% endfor %}
{% endautoescape %} {% endautoescape %}

View File

@ -178,7 +178,10 @@ 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
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 = {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 return newdata