added email adress of user to model and form

This commit is contained in:
Benni Bärmann 2021-03-15 15:27:08 +01:00
parent 63e6a6bdfd
commit f99a3e0fdf
3 changed files with 34 additions and 2 deletions

View File

@ -29,7 +29,7 @@ class PersonalForm(EvaForm):
class Meta: class Meta:
model = Employee model = Employee
fields = ['firstname', 'lastname', 'intern', 'email', 'department', 'team', ] fields = ['usermail', 'firstname', 'lastname', 'intern', 'email', 'department', 'team', ]
class WorkingForm(EvaForm): class WorkingForm(EvaForm):

View File

@ -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),
),
]

View File

@ -43,11 +43,15 @@ TRANSPONDER_CHOICES = {'NORM': 'Allgemeiner Transponder',
'NOTRANS': 'Kein Transponder',} 'NOTRANS': 'Kein Transponder',}
class Employee(models.Model): 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 # personal data
firstname = models.CharField(max_length=50, verbose_name="Vorname") firstname = models.CharField(max_length=50, verbose_name="Vorname")
lastname = models.CharField(max_length=50, verbose_name="Nachname") lastname = models.CharField(max_length=50, verbose_name="Nachname")
intern = models.BooleanField(verbose_name='Interne_r Mitarbeiter_in?', default=True) 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()) department = models.CharField(max_length=5, choices=DEPARTMENT_CHOICES.items())
team = models.CharField(max_length=20, null=True, blank=True) # TODO? besser als choices? team = models.CharField(max_length=20, null=True, blank=True) # TODO? besser als choices?