diff --git a/tjdests/apps/authentication/urls.py b/tjdests/apps/authentication/urls.py index e1a6873..e59629a 100644 --- a/tjdests/apps/authentication/urls.py +++ b/tjdests/apps/authentication/urls.py @@ -6,7 +6,7 @@ from . import views app_name = "authentication" urlpatterns = [ - path("", views.index_view, name="index"), + path("", views.IndexView.as_view(), name="index"), path("login", views.LoginViewCustom.as_view(), name="login"), path("logout", LogoutView.as_view(), name="logout"), path("tos", views.accept_tos_view, name="tos"), diff --git a/tjdests/apps/authentication/views.py b/tjdests/apps/authentication/views.py index 717e9bb..24bd3e5 100644 --- a/tjdests/apps/authentication/views.py +++ b/tjdests/apps/authentication/views.py @@ -5,12 +5,13 @@ from django.contrib.auth.views import LoginView from django.http import HttpRequest, HttpResponse from django.shortcuts import redirect, render from django.urls import reverse +from django.views.generic import TemplateView from tjdests.apps.authentication.forms import TOSForm -def index_view(request: HttpRequest) -> HttpResponse: - return render(request, "authentication/index.html") +class IndexView(TemplateView): + template_name = "authentication/index.html" @login_required