ChangeForm included

This commit is contained in:
Benni Bärmann 2021-02-02 10:30:00 +01:00
parent 2d1ac9b8c6
commit 99ea3ed37c
2 changed files with 11 additions and 4 deletions

View File

@ -48,3 +48,9 @@ class OfficeForm(FdbForm):
class Meta: class Meta:
model = Employee model = Employee
fields = ['transponder', 'post_office_box',] fields = ['transponder', 'post_office_box',]
class ChangeForm(FdbForm):
class Meta:
model = Employee
fields = ['firstdate_employment', 'jobdescription_german', 'jobdescription_english',
'desk', 'comment', 'accounts', 'lists', 'transponder']

View File

@ -11,7 +11,8 @@ from django.shortcuts import render
from .models import Employee, DEPARTMENT_CHOICES, LAPTOP_CHOICES, OS_CHOICES,\ from .models import Employee, DEPARTMENT_CHOICES, LAPTOP_CHOICES, OS_CHOICES,\
MOBILE_CHOICES, LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES MOBILE_CHOICES, LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES
from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm from .forms import PersonalForm, WorkingForm, ITForm, OfficeForm, DummyForm,\
ChangeForm, TYPE_CHOICES
from .settings import MAILS, EVA_MAIL, BASIC_DATA from .settings import MAILS, EVA_MAIL, BASIC_DATA
def success(request): def success(request):
@ -58,13 +59,13 @@ class EvaFormView(CookieWizardView):
form = super().get_form(step, data, files) form = super().get_form(step, data, files)
if step == '2': # why do we need step 2 here not 1???! if step == '1': # why do we need step 2 here not 1???!
prev_data = self.get_cleaned_data_for_step('0') prev_data = self.get_cleaned_data_for_step('0')
choice = prev_data.get('choice') choice = prev_data.get('choice')
print(f'choice detection: {INTERN_CHOICES[choice]}') print(f'choice detection: {TYPE_CHOICES[choice]}')
if choice == 'CHANGE': if choice == 'CHANGE':
print("process choosen: CHANGE") print("process choosen: CHANGE")
form = WorkingForm(data) form = ChangeForm(data)
elif choice == 'OUT': elif choice == 'OUT':
print("process choosen: OUT") print("process choosen: OUT")
form = WorkingForm(data) form = WorkingForm(data)