new field keyboard layout, removed field landline

This commit is contained in:
Benni Bärmann 2021-05-04 12:45:41 +02:00
parent 910c24f703
commit b2493e01b0
4 changed files with 39 additions and 11 deletions

View File

@ -50,7 +50,7 @@ class ITForm(EvaForm):
class Meta: class Meta:
model = Employee model = Employee
fields = [ fields = [
'laptop', 'vendor', 'os', 'screen', 'mobile', 'sim', 'landline', 'comment', 'laptop', 'vendor', 'os', 'keyboard', 'screen', 'mobile', 'sim', 'comment',
'language', 'accounts', 'lists', 'rebu2go' ] 'language', 'accounts', 'lists', 'rebu2go' ]
class OfficeForm(EvaForm): class OfficeForm(EvaForm):

View File

@ -0,0 +1,27 @@
# Generated by Django 3.1.4 on 2021-05-04 10:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('evapp', '0015_remove_employee_email'),
]
operations = [
migrations.RemoveField(
model_name='employee',
name='landline',
),
migrations.AddField(
model_name='employee',
name='keyboard',
field=models.CharField(choices=[('DE', 'Deutsch'), ('US', 'USA'), ('OT', 'Anderes (Bitte unten angeben)')], default='DE', max_length=2, verbose_name='Tastaturlayout'),
),
migrations.AlterField(
model_name='employee',
name='department',
field=models.CharField(choices=[('PROG', 'Programme'), ('SOFT', 'Softwareentwicklung'), ('CENT', 'Central'), ('VOR', 'Vorstand')], max_length=5, verbose_name='Bereich'),
),
]

View File

@ -29,6 +29,10 @@ OS_CHOICES = {'UBU': 'Ubuntu (Standard)',
LANG_CHOICES = {'GER': 'Deutsch', LANG_CHOICES = {'GER': 'Deutsch',
'ENG': 'English',} 'ENG': 'English',}
KEYBOARD_CHOICES = {'DE': 'Deutsch',
'US': 'USA',
'OT': 'Anderes (Bitte unten angeben)'}
ACCOUNT_CHOICES = {'OTRSWMDE': 'OTRS Ticketsystem', ACCOUNT_CHOICES = {'OTRSWMDE': 'OTRS Ticketsystem',
'CIVIC1': 'Civic CRM (allgemein)', 'CIVIC1': 'Civic CRM (allgemein)',
'CIVIC2': "Civic CRM (Mailings, impliziert allgemein)", 'CIVIC2': "Civic CRM (Mailings, impliziert allgemein)",
@ -51,7 +55,7 @@ class Employee(models.Model):
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 ders Mitarbeitenden") # 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(), verbose_name='Bereich')
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?
# general work related stuff # general work related stuff
@ -69,9 +73,8 @@ class Employee(models.Model):
screen = models.BooleanField(default=False, verbose_name='Zusätzlicher Monitor? Einer ist standard.') screen = models.BooleanField(default=False, verbose_name='Zusätzlicher Monitor? Einer ist standard.')
mobile = models.BooleanField(max_length=6, default=False, verbose_name='Handy benötigt?') mobile = models.BooleanField(max_length=6, default=False, verbose_name='Handy benötigt?')
sim = models.BooleanField(default=False, verbose_name="Mobilfunkvertrag") sim = models.BooleanField(default=False, verbose_name="Mobilfunkvertrag")
# sim2 = models.BooleanField(default=False, verbose_name="Zweite Sim (für Laptop zB)") # do we still need this? # landline = models.BooleanField(default=True, verbose_name="Festnetztelefon") # do we still need this?
landline = models.BooleanField(default=True, verbose_name="Festnetztelefon") # do we still need this? keyboard = models.CharField(max_length=2, choices=KEYBOARD_CHOICES.items(), default='DE', verbose_name="Tastaturlayout")
# TODO: tastaturlayout DE/US
comment = models.TextField(max_length=500, null=True, blank=True, verbose_name="zusätzliche IT-Anforderungen") comment = models.TextField(max_length=500, null=True, blank=True, verbose_name="zusätzliche IT-Anforderungen")
language = models.CharField(max_length=3, choices=LANG_CHOICES.items(), default="GER") language = models.CharField(max_length=3, choices=LANG_CHOICES.items(), default="GER")
accounts = MultiSelectField(choices=ACCOUNT_CHOICES.items(), null=True, blank=True, verbose_name="Zusätzliche Accounts") accounts = MultiSelectField(choices=ACCOUNT_CHOICES.items(), null=True, blank=True, verbose_name="Zusätzliche Accounts")

View File

@ -12,7 +12,7 @@ from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import LoginRequiredMixin
from .models import Employee, DEPARTMENT_CHOICES, LAPTOP_CHOICES, OS_CHOICES, VENDOR_CHOICES, \ from .models import Employee, DEPARTMENT_CHOICES, LAPTOP_CHOICES, OS_CHOICES, VENDOR_CHOICES, \
LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES, KEYBOARD_CHOICES
from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm,\ from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm,\
ChangeForm, TYPE_CHOICES ChangeForm, TYPE_CHOICES
from .settings import MAILS, EVA_MAIL, BASIC_DATA, ONLY_ONBOARDING from .settings import MAILS, EVA_MAIL, BASIC_DATA, ONLY_ONBOARDING
@ -56,8 +56,8 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
self.choice = c self.choice = c
def generate_email(self, data): def generate_email(self, data):
(first, junk) = data['firstname'].split(maxsplit=1) (first, *_) = data['firstname'].split(maxsplit=1)
(last, junk) = data['lastname'].split(maxsplit=1) (last, *_) = data['lastname'].split(maxsplit=1)
name = first + '.' + last name = first + '.' + last
if not data['intern']: if not data['intern']:
mail = name + '_ext@wikimedia.de' mail = name + '_ext@wikimedia.de'
@ -164,11 +164,9 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView):
# #
''' '''
# print("BEAUTIFY")
# update values in data dictionary with keys from *_CHOICES if present there # update values in data dictionary with keys from *_CHOICES if present there
choices = {**DEPARTMENT_CHOICES, **LAPTOP_CHOICES, **TRANSPONDER_CHOICES, choices = {**DEPARTMENT_CHOICES, **LAPTOP_CHOICES, **TRANSPONDER_CHOICES,
**OS_CHOICES, **LANG_CHOICES, **VENDOR_CHOICES} **OS_CHOICES, **LANG_CHOICES, **VENDOR_CHOICES, **KEYBOARD_CHOICES}
data.update({k:choices[v] for k,v in data.items() \ data.update({k:choices[v] for k,v in data.items() \
if isinstance(v,collections.abc.Hashable) \ if isinstance(v,collections.abc.Hashable) \
and v in choices}) and v in choices})