Skip to content

Commit 7c7c5da

Browse files
committed
Changed the 2.1 removed django.contrib.auth.views.logout to LogoutView.
- Legacy-Id: 18052
1 parent dc7581f commit 7c7c5da

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

ietf/ietfauth/tests.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from unittest import skipIf
2525
from urllib.parse import urlsplit
2626

27-
import django.contrib.auth.views
2827
from django.urls import reverse as urlreverse
2928
from django.contrib.auth.models import User
3029
from django.conf import settings
@@ -91,7 +90,7 @@ def test_login_and_logout(self):
9190
self.assertEqual(urlsplit(r["Location"])[2], urlreverse(ietf.ietfauth.views.profile))
9291

9392
# try logging out
94-
r = self.client.get(urlreverse(django.contrib.auth.views.logout))
93+
r = self.client.get(urlreverse('django.contrib.auth.views.logout'))
9594
self.assertEqual(r.status_code, 200)
9695

9796
r = self.client.get(urlreverse(ietf.ietfauth.views.profile))
@@ -198,7 +197,7 @@ def test_create_whitelisted_account(self):
198197
self.assertContains(r, "Whitelist entry creation successful")
199198

200199
# log out
201-
r = self.client.get(urlreverse(django.contrib.auth.views.logout))
200+
r = self.client.get(urlreverse('django.contrib.auth.views.logout'))
202201
self.assertEqual(r.status_code, 200)
203202

204203
# register and verify whitelisted email

ietf/ietfauth/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright The IETF Trust 2007-2019, All Rights Reserved
22
# Copyright The IETF Trust 2007, 2009, All Rights Reserved
33

4-
from django.contrib.auth.views import logout # type: ignore
4+
from django.contrib.auth.views import LogoutView # type: ignore
55

66
from ietf.ietfauth import views
77
from ietf.utils.urls import url
@@ -15,7 +15,7 @@
1515
url(r'^create/$', views.create_account),
1616
url(r'^create/confirm/(?P<auth>[^/]+)/$', views.confirm_account),
1717
url(r'^login/$', views.login),
18-
url(r'^logout/$', logout),
18+
url(r'^logout/$', LogoutView.as_view(), name="django.contrib.auth.views.logout"),
1919
url(r'^password/$', views.change_password),
2020
url(r'^profile/$', views.profile),
2121
url(r'^reset/$', views.password_reset),

0 commit comments

Comments
 (0)