From db36e1cdc920bff4c826446c610356ba92b309bf Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 4 May 2021 14:51:21 +0200 Subject: [PATCH] True/False => Ja/Nein in data, slightly changed verbose_name for usermail --- TODO | 2 -- evapp/migrations/0018_auto_20210504_1251.py | 18 ++++++++++++++++++ evapp/models.py | 2 +- evapp/views.py | 7 ++++++- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 evapp/migrations/0018_auto_20210504_1251.py diff --git a/TODO b/TODO index 2b913ba..8b13789 100644 --- a/TODO +++ b/TODO @@ -1,3 +1 @@ -- in mail ändern "Deine mailadresse" in "ansprechpartner_in" -- true/false übersetzen in dataloop diff --git a/evapp/migrations/0018_auto_20210504_1251.py b/evapp/migrations/0018_auto_20210504_1251.py new file mode 100644 index 0000000..649fc17 --- /dev/null +++ b/evapp/migrations/0018_auto_20210504_1251.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.4 on 2021-05-04 12:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('evapp', '0017_auto_20210504_1224'), + ] + + operations = [ + migrations.AlterField( + model_name='employee', + name='usermail', + field=models.EmailField(default='bestechefin@wikimedia.de', max_length=50, verbose_name='Deine Mailadresse (Ansprechpartner_in)'), + ), + ] diff --git a/evapp/models.py b/evapp/models.py index 77b4490..9fc13dc 100644 --- a/evapp/models.py +++ b/evapp/models.py @@ -48,7 +48,7 @@ TRANSPONDER_CHOICES = {'NORM': 'Allgemeiner Transponder', class Employee(models.Model): # email adress of user. should not be necessary if we use openauth one day - usermail = models.EmailField(max_length=50, verbose_name="Deine Mailadresse", default='bestechefin@wikimedia.de') + usermail = models.EmailField(max_length=50, verbose_name="Deine Mailadresse (Ansprechpartner_in)", default='bestechefin@wikimedia.de') # personal data firstname = models.CharField(max_length=50, verbose_name="Vorname") diff --git a/evapp/views.py b/evapp/views.py index f973b27..0bfef77 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -181,5 +181,10 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): mail = data.pop('email') newdata = {self.instance._meta.get_field(k).verbose_name.title() : v for k,v in data.items()} if mail: - newdata['email'] = mail + newdata['Email'] = mail + + #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}) + return newdata