From 99ea3ed37cf8210018552d721d97e7fa7801bf9d Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 2 Feb 2021 10:30:00 +0100 Subject: [PATCH] ChangeForm included --- evapp/forms.py | 6 ++++++ evapp/views.py | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/evapp/forms.py b/evapp/forms.py index bddbcff..69ccbdb 100644 --- a/evapp/forms.py +++ b/evapp/forms.py @@ -48,3 +48,9 @@ class OfficeForm(FdbForm): class Meta: model = Employee fields = ['transponder', 'post_office_box',] + +class ChangeForm(FdbForm): + class Meta: + model = Employee + fields = ['firstdate_employment', 'jobdescription_german', 'jobdescription_english', + 'desk', 'comment', 'accounts', 'lists', 'transponder'] diff --git a/evapp/views.py b/evapp/views.py index 74bbc13..75705d2 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -11,7 +11,8 @@ from django.shortcuts import render from .models import Employee, DEPARTMENT_CHOICES, LAPTOP_CHOICES, OS_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 def success(request): @@ -58,13 +59,13 @@ class EvaFormView(CookieWizardView): 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') choice = prev_data.get('choice') - print(f'choice detection: {INTERN_CHOICES[choice]}') + print(f'choice detection: {TYPE_CHOICES[choice]}') if choice == 'CHANGE': print("process choosen: CHANGE") - form = WorkingForm(data) + form = ChangeForm(data) elif choice == 'OUT': print("process choosen: OUT") form = WorkingForm(data)