chore(authentication): use built in LoginView

This commit is contained in:
Ethan Nguyen 2021-04-23 23:48:43 -04:00
parent b9c8517b82
commit 0b4f03af36
No known key found for this signature in database
GPG Key ID: B4CA5339AF911920
2 changed files with 3 additions and 7 deletions

View File

@ -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"),
]

View File

@ -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"