mirror of
https://github.com/ae-utbm/sith.git
synced 2024-10-31 19:38:04 +00:00
django2.2: replace deprecated login view
This commit is contained in:
parent
99c8d95443
commit
308cf30a5a
@ -37,7 +37,7 @@ urlpatterns = [
|
|||||||
re_path(r"^search_json/$", search_json, name="search_json"),
|
re_path(r"^search_json/$", search_json, name="search_json"),
|
||||||
re_path(r"^search_user/$", search_user_json, name="search_user"),
|
re_path(r"^search_user/$", search_user_json, name="search_user"),
|
||||||
# Login and co
|
# 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"^logout/$", logout, name="logout"),
|
||||||
re_path(r"^password_change/$", password_change, name="password_change"),
|
re_path(r"^password_change/$", password_change, name="password_change"),
|
||||||
re_path(
|
re_path(
|
||||||
|
@ -69,15 +69,13 @@ from counter.views import StudentCardForm
|
|||||||
from trombi.views import UserTrombiForm
|
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
|
template_name = "core/login.jinja"
|
||||||
"""
|
authentication_form = LoginForm
|
||||||
return views.login(
|
|
||||||
request, template_name="core/login.jinja", authentication_form=LoginForm
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def logout(request):
|
def logout(request):
|
||||||
|
Loading…
Reference in New Issue
Block a user