File: 0002-django-2.1-Use-class-based-views-in-auth_urls.patch

package info (click to toggle)
python-django-registration 2.2-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 828 kB
  • sloc: python: 1,573; makefile: 85
file content (56 lines) | stat: -rw-r--r-- 2,336 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From: =?utf-8?q?Stephan_S=C3=BCrken?= <absurd@olurdix.de>
Date: Wed, 17 Jul 2019 17:59:16 +0200
Subject: django 2.1: Use class based views in auth_urls.

See: https://docs.djangoproject.com/en/2.2/releases/2.1/#features-removed-in-2-1
---
 registration/auth_urls.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/registration/auth_urls.py b/registration/auth_urls.py
index 90d71b3..8abb122 100644
--- a/registration/auth_urls.py
+++ b/registration/auth_urls.py
@@ -16,34 +16,34 @@ from django.contrib.auth import views as auth_views
 
 urlpatterns = [
     url(r'^login/$',
-        auth_views.login,
+        auth_views.LoginView.as_view(),
         {'template_name': 'registration/login.html'},
         name='auth_login'),
     url(r'^logout/$',
-        auth_views.logout,
+        auth_views.LogoutView.as_view(),
         {'template_name': 'registration/logout.html'},
         name='auth_logout'),
     url(r'^password/change/$',
-        auth_views.password_change,
+        auth_views.PasswordChangeView.as_view(),
         {'post_change_redirect': 'auth_password_change_done'},
         name='auth_password_change'),
     url(r'^password/change/done/$',
-        auth_views.password_change_done,
+        auth_views.PasswordChangeDoneView.as_view(),
         name='auth_password_change_done'),
     url(r'^password/reset/$',
-        auth_views.password_reset,
+        auth_views.PasswordResetView.as_view(),
         {'post_reset_redirect': 'auth_password_reset_done',
          'email_template_name': 'registration/password_reset_email.txt'},
         name='auth_password_reset'),
     url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/'
         r'(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
-        auth_views.password_reset_confirm,
+        auth_views.PasswordResetConfirmView.as_view(),
         {'post_reset_redirect': 'auth_password_reset_complete'},
         name='auth_password_reset_confirm'),
     url(r'^password/reset/complete/$',
-        auth_views.password_reset_complete,
+        auth_views.PasswordResetCompleteView.as_view(),
         name='auth_password_reset_complete'),
     url(r'^password/reset/done/$',
-        auth_views.password_reset_done,
+        auth_views.PasswordResetDoneView.as_view(),
         name='auth_password_reset_done'),
 ]