From f99a3e0fdff59220067070863b0894ac75870a38 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 15 Mar 2021 15:27:08 +0100 Subject: [PATCH] added email adress of user to model and form --- evapp/forms.py | 2 +- evapp/migrations/0009_auto_20210315_1408.py | 28 +++++++++++++++++++++ evapp/models.py | 6 ++++- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 evapp/migrations/0009_auto_20210315_1408.py diff --git a/evapp/forms.py b/evapp/forms.py index 2e277db..862542b 100644 --- a/evapp/forms.py +++ b/evapp/forms.py @@ -29,7 +29,7 @@ class PersonalForm(EvaForm): class Meta: model = Employee - fields = ['firstname', 'lastname', 'intern', 'email', 'department', 'team', ] + fields = ['usermail', 'firstname', 'lastname', 'intern', 'email', 'department', 'team', ] class WorkingForm(EvaForm): diff --git a/evapp/migrations/0009_auto_20210315_1408.py b/evapp/migrations/0009_auto_20210315_1408.py new file mode 100644 index 0000000..d1c8c32 --- /dev/null +++ b/evapp/migrations/0009_auto_20210315_1408.py @@ -0,0 +1,28 @@ +# Generated by Django 3.1.4 on 2021-03-15 14:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('evapp', '0008_auto_20210301_1053'), + ] + + operations = [ + migrations.AddField( + model_name='employee', + name='usermail', + field=models.EmailField(default='bestechefin@wikimedia.de', max_length=50, verbose_name='Deine Mailadresse'), + ), + migrations.AlterField( + model_name='employee', + name='email', + field=models.EmailField(max_length=50, verbose_name='E-Mail-Adresse ders Mitarbeitenden'), + ), + migrations.AlterField( + model_name='employee', + name='laptop', + field=models.CharField(choices=[('14', '14", Unser Standardgerät'), ('12', '12,5", Geeignet für Vielreisende')], default='14', max_length=2), + ), + ] diff --git a/evapp/models.py b/evapp/models.py index 04a6f97..3984b84 100644 --- a/evapp/models.py +++ b/evapp/models.py @@ -43,11 +43,15 @@ TRANSPONDER_CHOICES = {'NORM': 'Allgemeiner Transponder', 'NOTRANS': 'Kein 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') + # personal data firstname = models.CharField(max_length=50, verbose_name="Vorname") lastname = models.CharField(max_length=50, verbose_name="Nachname") intern = models.BooleanField(verbose_name='Interne_r Mitarbeiter_in?', default=True) - email = models.EmailField(max_length=50, verbose_name="E-Mail-Adresse") + email = models.EmailField(max_length=50, verbose_name="E-Mail-Adresse ders Mitarbeitenden") department = models.CharField(max_length=5, choices=DEPARTMENT_CHOICES.items()) team = models.CharField(max_length=20, null=True, blank=True) # TODO? besser als choices?