From 0b4f03af36f2edfcb757a26d1c31ff9092f9f5de Mon Sep 17 00:00:00 2001 From: Ethan Nguyen Date: Fri, 23 Apr 2021 23:48:43 -0400 Subject: [PATCH] chore(authentication): use built in LoginView --- tjdests/apps/authentication/urls.py | 6 +++--- tjdests/apps/authentication/views.py | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tjdests/apps/authentication/urls.py b/tjdests/apps/authentication/urls.py index e59629a..9824fca 100644 --- a/tjdests/apps/authentication/urls.py +++ b/tjdests/apps/authentication/urls.py @@ -1,4 +1,4 @@ -from django.contrib.auth.views import LogoutView +from django.contrib.auth import views as auth_views from django.urls import path from . import views @@ -7,7 +7,7 @@ app_name = "authentication" urlpatterns = [ path("", views.IndexView.as_view(), name="index"), - path("login", views.LoginViewCustom.as_view(), name="login"), - path("logout", LogoutView.as_view(), name="logout"), + path("login", auth_views.LoginView.as_view(template_name="authentication/login.html"), name="login"), + path("logout", auth_views.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 24bd3e5..08307c4 100644 --- a/tjdests/apps/authentication/views.py +++ b/tjdests/apps/authentication/views.py @@ -49,7 +49,3 @@ def accept_tos_view(request: HttpRequest) -> HttpResponse: context = {"form": form} return render(request, "authentication/accept_tos.html", context=context) - - -class LoginViewCustom(LoginView): - template_name = "authentication/login.html"