Fixed login/logout for Django 2.1.

In django.contrib.auth.views, the login and logout funcs are removed as of Django 2.1.  Helpdesk's urls.py needs to be updated to use the LoginView and LogoutView classes instead, which were introduced in Django 1.11.
This commit is contained in:
Adrian Boyko 2018-08-19 18:59:08 -07:00 committed by GitHub
parent 73f113540f
commit 4526d7c537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,13 +185,14 @@ urlpatterns += [
urlpatterns += [
url(r'^login/$',
auth_views.login,
{'template_name': 'helpdesk/registration/login.html'},
auth_views.LoginView.as_view(
template_name='helpdesk/registration/login.html'),
name='login'),
url(r'^logout/$',
auth_views.logout,
{'template_name': 'helpdesk/registration/login.html', 'next_page': '../'},
auth_views.LogoutView.as_view(
template_name='helpdesk/registration/login.html',
next_page='../'),
name='logout'),
]