Verified Commit 308cf30a authored by Sli's avatar Sli
Browse files

django2.2: replace deprecated login view

parent 99c8d954
......@@ -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(
......
......@@ -69,15 +69,13 @@ from counter.views import StudentCardForm
from trombi.views import UserTrombiForm
def login(request):
class SithLoginView(views.LoginView):
"""
The login view
Needs to be improve with correct handling of form exceptions
The login View
"""
return views.login(
request, template_name="core/login.jinja", authentication_form=LoginForm
)
template_name = "core/login.jinja"
authentication_form = LoginForm
def logout(request):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment