django22: The 'login' functional-based view is gone (pt. 1)

As noted in the Django 2.1 release notes [1]:

  'contrib.auth.views.login()', 'logout()', 'password_change()',
  'password_change_done()', 'password_reset()', 'password_reset_done()',
  'password_reset_confirm()', and 'password_reset_complete()' are
  removed.

It's been replaced by a class-based view (CBV). There's a larger cleanup
needed, but this tackles one aspect of the change.

With this change, all the tests for the horizon application are now
passing with Django 2.2.

[1] https://docs.djangoproject.com/en/2.2/releases/2.1/#features-removed-in-2-1

Change-Id: Ib476e05cfcb5f6311189646d5f3c416f189744da
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2019-08-26 15:38:32 +01:00
parent fbcfdf5f86
commit 49b6250edc

View File

@ -33,7 +33,8 @@ from horizon.test.jasmine import jasmine
urlpatterns = [
url(r'', horizon.base._wrapped_include(horizon.urls)),
url(r"auth/login/", views.login, {'template_name': "auth/login.html"},
url(r"auth/login/",
views.LoginView.as_view(template_name="auth/login.html"),
name='login'),
url(r'auth/', include('django.contrib.auth.urls')),
url(r'^jasmine/.*?$', jasmine.dispatcher),