From 07b4e9bf72dcb23b5c40adb34a8fbddb942a07a5 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 19 Jan 2021 10:32:31 +0100 Subject: [PATCH] use beautify_data() in mails too. added TODO with known bug --- TODO | 3 +++ evapp/views.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 TODO diff --git a/TODO b/TODO new file mode 100644 index 0000000..57b7fb1 --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +known bugs: + +html problem in mails: 14" -> 14" diff --git a/evapp/views.py b/evapp/views.py index 66a6fb4..f49fe82 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -58,7 +58,7 @@ class EvaFormView(CookieWizardView): data = self.get_all_cleaned_data() newdata = {k: v for k, v in data.items() if (k in MAILS[department]['DATA'])} - context = {'data': newdata} + context = {'data': self.beautify_data(newdata)} try: mail_template = get_template(f'evapp/{department}_mail.txt') @@ -90,7 +90,8 @@ class EvaFormView(CookieWizardView): and v in choices}) # replace values in accounts array from *_CHOICES - data['accounts'] = [ACCOUNT_CHOICES[c] for c in data['accounts']] + if 'accounts' in data: + data['accounts'] = [ACCOUNT_CHOICES[c] for c in data['accounts']] # replace keys in data dictionary with verbose_name