|
@ -23,7 +23,7 @@ def authorize(request, choice, pk): |
|
|
Library.set_granted(pk,True) |
|
|
Library.set_granted(pk,True) |
|
|
return HttpResponse(f"AUTHORIZED! choice: {choice}, pk: {pk}") |
|
|
return HttpResponse(f"AUTHORIZED! choice: {choice}, pk: {pk}") |
|
|
else: |
|
|
else: |
|
|
return HttpResponse('ERROR! UNKNWON CHOICE TYPE!') |
|
|
|
|
|
|
|
|
return HttpResponse(f'ERROR! UNKNWON CHOICE TYPE! {choice}') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def deny(request, choice, pk): |
|
|
def deny(request, choice, pk): |
|
@ -34,7 +34,7 @@ def deny(request, choice, pk): |
|
|
Library.set_granted(pk,False) |
|
|
Library.set_granted(pk,False) |
|
|
return HttpResponse(f"DENIED! choice: {choice}, pk: {pk}") |
|
|
return HttpResponse(f"DENIED! choice: {choice}, pk: {pk}") |
|
|
else: |
|
|
else: |
|
|
return HttpResponse('ERROR! UNKNWON CHOICE TYPE!') |
|
|
|
|
|
|
|
|
return HttpResponse(f'ERROR! UNKNWON CHOICE TYPE {choice}!') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# def project(request): |
|
|
# def project(request): |
|
@ -60,7 +60,7 @@ def done(request): |
|
|
return HttpResponse("Your data is save now.") |
|
|
return HttpResponse("Your data is save now.") |
|
|
|
|
|
|
|
|
class InternView(CookieWizardView): |
|
|
class InternView(CookieWizardView): |
|
|
'''This View is for the WMDE-employees only''' |
|
|
|
|
|
|
|
|
'''This View is for WMDE-employees only''' |
|
|
|
|
|
|
|
|
template_name = 'input/extern.html' |
|
|
template_name = 'input/extern.html' |
|
|
form_list = [InternForm, ProjectForm] |
|
|
form_list = [InternForm, ProjectForm] |
|
@ -76,8 +76,11 @@ class InternView(CookieWizardView): |
|
|
if choice == 'HON': |
|
|
if choice == 'HON': |
|
|
print ('Ehrenamtsbescheinigung detected!') |
|
|
print ('Ehrenamtsbescheinigung detected!') |
|
|
form = HonoraryCertificateForm(data) |
|
|
form = HonoraryCertificateForm(data) |
|
|
|
|
|
elif choice == 'PRO': |
|
|
|
|
|
print ('Projektsteckbrief erreicht!') |
|
|
|
|
|
form = ProjectForm(data) |
|
|
else: |
|
|
else: |
|
|
raise RuntimeError('ERROR! UNKNOWN FORMTYPE!') |
|
|
|
|
|
|
|
|
raise RuntimeError(f'ERROR! UNKNOWN FORMTYPE {choice}') |
|
|
else: |
|
|
else: |
|
|
form = super().get_form(step, data, files) |
|
|
form = super().get_form(step, data, files) |
|
|
return form |
|
|
return form |
|
@ -128,7 +131,7 @@ class ExternView(CookieWizardView): |
|
|
form = LibraryForm(data) |
|
|
form = LibraryForm(data) |
|
|
form.fields['library'].label = v |
|
|
form.fields['library'].label = v |
|
|
else: |
|
|
else: |
|
|
raise RuntimeError('ERROR! UNKNOWN FORMTYPE!') |
|
|
|
|
|
|
|
|
raise RuntimeError(f'ERROR! UNKNOWN FORMTYPE {choice}') |
|
|
else: |
|
|
else: |
|
|
form = super().get_form(step, data, files) |
|
|
form = super().get_form(step, data, files) |
|
|
return form |
|
|
return form |
|
|