first step offboarding ready

This commit is contained in:
Benni Bärmann 2021-11-10 15:48:12 +01:00
parent da8c744227
commit e61c28aae3
2 changed files with 16 additions and 7 deletions

View File

@ -32,7 +32,7 @@ class PersonalForm(EvaForm):
class OffboardingForm(EvaForm): class OffboardingForm(EvaForm):
class Meta: class Meta:
model: Employee model = Employee
fields = ['lastdate_employment'] fields = ['lastdate_employment']
widgets = {'lastdate_employment' : DateInput(attrs={'type': 'date'})} widgets = {'lastdate_employment' : DateInput(attrs={'type': 'date'})}

View File

@ -28,20 +28,29 @@ def long_process(wizard):
return True return True
else: else:
data = wizard.get_cleaned_data_for_step('0') or {} data = wizard.get_cleaned_data_for_step('0') or {}
print(data) # print(data)
if data.get('choice') != 'CHANGE': if data.get('choice') == 'IN':
wizard.set_choice('IN') wizard.set_choice('IN')
#print('PROZESS IN') print('PROZESS IN')
return True return True
else: else:
wizard.set_choice('CHANGE')
#print('PROZESS NOT IN')
return False return False
#wizard.set_choice('CHANGE')
#print('PROZESS CHANGE')
#return False
def offboarding_process(wizard): def offboarding_process(wizard):
''' this method is called via urls.py to determine if the form is part of the change process''' ''' this method is called via urls.py to determine if the form is part of the change process'''
print('OFFBOARDING PROZESS') 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): def change_process(wizard):
''' this method is called via urls.py to determine if the form is part of the change process''' ''' this method is called via urls.py to determine if the form is part of the change process'''