From 2de76d44d5851191c784c56720a506820df6cfef Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 3 May 2021 15:49:05 +0200 Subject: [PATCH] Mobile is BooleanField now. --- TODO | 5 +++++ evapp/models.py | 17 +++++++++-------- evapp/views.py | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index e69de29..d3e74b2 100644 --- a/TODO +++ b/TODO @@ -0,0 +1,5 @@ +- remove empty lines in mail + +- in mail ändern "Deine mailadresse" in "ansprechpartner_in" + +- true/false übersetzen in dataloop diff --git a/evapp/models.py b/evapp/models.py index cdaaaf3..bed2f1e 100644 --- a/evapp/models.py +++ b/evapp/models.py @@ -21,10 +21,10 @@ VENDOR_CHOICES = {'STANDARD': 'Dell Latitude', OS_CHOICES = {'UBU': 'Ubuntu (Standard)', 'WIN': 'Windows (bitte Begründung angeben)',} -MOBILE_CHOICES = {'NO': 'Kein Mobiltelefon', - 'SIMPLE': 'Einfaches Gerät für Erreichbarkeit', - 'SINGLE': 'Smartphone, Single SIM', - 'DUAL': 'Smartphone, Dual SIM',} +# MOBILE_CHOICES = {'NO': 'Kein Mobiltelefon', +# 'SIMPLE': 'Einfaches Gerät für Erreichbarkeit', +# 'SINGLE': 'Smartphone, Single SIM', +# 'DUAL': 'Smartphone, Dual SIM',} LANG_CHOICES = {'GER': 'Deutsch', 'ENG': 'English',} @@ -62,16 +62,17 @@ class Employee(models.Model): jobdescription_english = models.CharField(null=True, max_length=100, verbose_name="Job description(english)") remote = models.BooleanField(verbose_name='Braucht keinen Arbeitsplatz weil Home-Office', default=False) desk = models.CharField(max_length=100, null=True, blank=True, verbose_name="Wo soll der Arbeitsplatz sein?") - + # IT related stuff laptop = models.CharField(max_length=2, choices=LAPTOP_CHOICES.items(), default='14') vendor = models.CharField(max_length=8, choices=VENDOR_CHOICES.items(), default='STANDARD') os = models.CharField(max_length=3, choices=OS_CHOICES.items(), default='UBU') screen = models.BooleanField(default=False, verbose_name='Zusätzlicher Monitor? Einer ist standard.') - mobile = models.CharField(max_length=6, default='NO') + mobile = models.BooleanField(max_length=6, default=False) sim = models.BooleanField(default=False, verbose_name="Mobilfunkvertrag") - sim2 = models.BooleanField(default=False, verbose_name="Zweite Sim (für Laptop zB)") - landline = models.BooleanField(default=True, verbose_name="Festnetztelefon") + 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? + # TODO: tastaturlayout DE/US 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") accounts = MultiSelectField(choices=ACCOUNT_CHOICES.items(), null=True) diff --git a/evapp/views.py b/evapp/views.py index c17031c..5202f6c 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -12,7 +12,7 @@ from django.conf import settings from django.contrib.auth.mixins import LoginRequiredMixin from .models import Employee, DEPARTMENT_CHOICES, LAPTOP_CHOICES, OS_CHOICES, VENDOR_CHOICES, \ - MOBILE_CHOICES, LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES + LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm,\ ChangeForm, TYPE_CHOICES from .settings import MAILS, EVA_MAIL, BASIC_DATA, ONLY_ONBOARDING @@ -164,7 +164,7 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): # update values in data dictionary with keys from *_CHOICES if present there choices = {**DEPARTMENT_CHOICES, **LAPTOP_CHOICES, **TRANSPONDER_CHOICES, - **OS_CHOICES, **MOBILE_CHOICES, **LANG_CHOICES, **VENDOR_CHOICES} + **OS_CHOICES, **LANG_CHOICES, **VENDOR_CHOICES} data.update({k:choices[v] for k,v in data.items() \ if isinstance(v,collections.abc.Hashable) \ and v in choices})