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