broken version, still working on authentification

Benni Bärmann 3 years ago
parent a0c57c7d4d
commit fa41a93325

@ -19,4 +19,5 @@ from django.urls import path, include
urlpatterns = [
path('', include("input.urls")),
path('accounts/', include('django.contrib.auth.urls')),

@ -8,6 +8,8 @@ from django.core.mail import send_mail, BadHeaderError
from django.conf import settings
from django.template.loader import get_template
from django.template import Context
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from .forms import ProjectForm, ExternForm, LibraryForm, IFGForm, LiteratureForm,\
HonoraryCertificateForm, InternForm, TravelForm, EmailForm,\
@ -27,7 +29,7 @@ def auth_deny(choice,pk,auth):
return HttpResponse(f'ERROR! UNKNWON CHOICE TYPE! {choice}')
return False
def authorize(request, choice, pk):
'''If IF grant a support they click a link in a mail which leads here.
We write the granted field in the database here and set a timestamp.'''
@ -38,7 +40,7 @@ def authorize(request, choice, pk):
return HttpResponse(f"AUTHORIZED! choice: {choice}, pk: {pk}")
def deny(request, choice, pk):
'''If IF denies a support they click a link in a mail which leads here
We write the granted field in the database here.'''
@ -53,7 +55,8 @@ def deny(request, choice, pk):
def done(request):
return HttpResponse("Your data is save now.")
class InternView(CookieWizardView):
class InternView(LoginRequiredMixin, CookieWizardView):
'''This View is for WMDE-employees only'''
template_name = 'input/extern.html'