diff --git a/evapp/forms.py b/evapp/forms.py index 747cedf..3d95731 100644 --- a/evapp/forms.py +++ b/evapp/forms.py @@ -32,7 +32,7 @@ class PersonalForm(EvaForm): class OffboardingForm(EvaForm): class Meta: - model: Employee + model = Employee fields = ['lastdate_employment'] widgets = {'lastdate_employment' : DateInput(attrs={'type': 'date'})} diff --git a/evapp/views.py b/evapp/views.py index bdc0feb..a58aa9a 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -28,20 +28,29 @@ def long_process(wizard): return True else: data = wizard.get_cleaned_data_for_step('0') or {} - print(data) - if data.get('choice') != 'CHANGE': + # print(data) + if data.get('choice') == 'IN': wizard.set_choice('IN') - #print('PROZESS IN') + print('PROZESS IN') return True else: - wizard.set_choice('CHANGE') - #print('PROZESS NOT IN') return False + #wizard.set_choice('CHANGE') + #print('PROZESS CHANGE') + #return False def offboarding_process(wizard): ''' this method is called via urls.py to determine if the form is part of the change process''' print('OFFBOARDING PROZESS') - return not long_process(wizard) + if not ONLY_ONBOARDING: + data = wizard.get_cleaned_data_for_step('0') or {} + print(data) + if data.get('choice') == 'OUT': + #print("PPPPPPPPPPPPPPP") + wizard.set_choice('OUT') + return True + # wizard.set_choice('IN') + return False def change_process(wizard): ''' this method is called via urls.py to determine if the form is part of the change process'''