django2.2: replace deprecated login view

This commit is contained in:
Antoine Bartuccio 2019-10-06 02:24:03 +02:00
parent 99c8d95443
commit 308cf30a5a
Signed by: klmp200
GPG Key ID: E7245548C53F904B
2 changed files with 6 additions and 8 deletions

View File

@ -37,7 +37,7 @@ urlpatterns = [
re_path(r"^search_json/$", search_json, name="search_json"),
re_path(r"^search_user/$", search_user_json, name="search_user"),
# Login and co
re_path(r"^login/$", login, name="login"),
re_path(r"^login/$", SithLoginView.as_view(), name="login"),
re_path(r"^logout/$", logout, name="logout"),
re_path(r"^password_change/$", password_change, name="password_change"),
re_path(

View File

@ -69,15 +69,13 @@ from counter.views import StudentCardForm
from trombi.views import UserTrombiForm
def login(request):
class SithLoginView(views.LoginView):
"""
The login View
"""
The login view
Needs to be improve with correct handling of form exceptions
"""
return views.login(
request, template_name="core/login.jinja", authentication_form=LoginForm
)
template_name = "core/login.jinja"
authentication_form = LoginForm
def logout(request):