|
@ -62,11 +62,15 @@ class ExternView(CookieWizardView): |
|
|
|
|
|
|
|
|
if step == '1': |
|
|
if step == '1': |
|
|
prev_data = self.get_cleaned_data_for_step('0') |
|
|
prev_data = self.get_cleaned_data_for_step('0') |
|
|
if prev_data.get('choice') == 'IFG': |
|
|
|
|
|
|
|
|
choice = prev_data.get('choice') |
|
|
|
|
|
if choice == 'IFG': |
|
|
print ('IFG detected!') |
|
|
print ('IFG detected!') |
|
|
form = IFGForm(data) |
|
|
form = IFGForm(data) |
|
|
else: |
|
|
|
|
|
|
|
|
elif choice in ('BIB', 'SOFT', 'ELIT'): |
|
|
|
|
|
print ('one of the famous three detected!') |
|
|
form = LibraryForm(data) |
|
|
form = LibraryForm(data) |
|
|
|
|
|
else: |
|
|
|
|
|
print('ERROR! UNKNOWN FORMTYPE!') |
|
|
else: |
|
|
else: |
|
|
form = super().get_form(step, data, files) |
|
|
form = super().get_form(step, data, files) |
|
|
return form |
|
|
return form |
|
@ -87,6 +91,8 @@ class ExternView(CookieWizardView): |
|
|
form.realname = data['realname'] |
|
|
form.realname = data['realname'] |
|
|
form.username = data['username'] |
|
|
form.username = data['username'] |
|
|
form.email = data['email'] |
|
|
form.email = data['email'] |
|
|
|
|
|
if data['choice'] in ('BIB', 'ELIT', 'SOFT'): |
|
|
|
|
|
form.type = data['choice'] |
|
|
form.save() |
|
|
form.save() |
|
|
|
|
|
|
|
|
# we need to send the following mails here: |
|
|
# we need to send the following mails here: |
|
|