From 5549088331feff84e39985321ebca7d54c14a285 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sun, 23 Mar 2014 23:17:15 +0000 Subject: [PATCH] With the complications caused by the TransactionMiddleware gone, we can use Django's default login() and logout() views. - Legacy-Id: 7539 --- ietf/ietfauth/urls.py | 8 ++++---- ietf/ietfauth/views.py | 12 ------------ ietf/templates/registration/change_password.html | 2 +- ietf/templates/registration/confirm.html | 2 +- .../registration/{loggedout.html => logged_out.html} | 0 5 files changed, 6 insertions(+), 18 deletions(-) rename ietf/templates/registration/{loggedout.html => logged_out.html} (100%) diff --git a/ietf/ietfauth/urls.py b/ietf/ietfauth/urls.py index 891158f4e..cbbe6c1f4 100644 --- a/ietf/ietfauth/urls.py +++ b/ietf/ietfauth/urls.py @@ -1,15 +1,15 @@ # Copyright The IETF Trust 2007, 2009, All Rights Reserved from django.conf.urls import patterns, url -from django.contrib.auth.views import login +from django.contrib.auth.views import login, logout urlpatterns = patterns('ietf.ietfauth.views', url(r'^$', 'index', name='account_index'), # url(r'^login/$', 'ietf_login'), url(r'^login/$', login), - url(r'^logout/$', 'logout_view'), - url(r'^loggedin/$', 'ietf_loggedin'), - url(r'^loggedout/$', 'logged_out'), + url(r'^logout/$', logout), +# url(r'^loggedin/$', 'ietf_loggedin'), +# url(r'^loggedout/$', 'logged_out'), url(r'^profile/$', 'profile'), # (r'^login/(?P[a-z0-9.@]+)/(?P.+)$', 'url_login'), url(r'^testemail/$', 'test_email'), diff --git a/ietf/ietfauth/views.py b/ietf/ietfauth/views.py index 4470f9e42..70a771882 100644 --- a/ietf/ietfauth/views.py +++ b/ietf/ietfauth/views.py @@ -260,15 +260,3 @@ def test_email(request): r.set_cookie("testmailcc", cookie) return r - -def logout_view(request): - try: - logout(request) - return HttpResponseRedirect('/accounts/loggedout/') - except Warning as w: - from ietf.utils.log import log - log(w) - return HttpResponseRedirect('/accounts/loggedout/') - -def logged_out(request): - return render_to_response('registration/loggedout.html', {'next':'/'}, context_instance=RequestContext(request)) diff --git a/ietf/templates/registration/change_password.html b/ietf/templates/registration/change_password.html index 736bd01f6..10fa5bd73 100644 --- a/ietf/templates/registration/change_password.html +++ b/ietf/templates/registration/change_password.html @@ -7,7 +7,7 @@

Change password

{% if success %}

Your password has been updated.

-

Now you can sign in

+

Now you can sign in

{% else %}

Hello, you can select a new password below for your user {{ username }}.

{% csrf_token %} diff --git a/ietf/templates/registration/confirm.html b/ietf/templates/registration/confirm.html index 70045d5f3..57a094587 100644 --- a/ietf/templates/registration/confirm.html +++ b/ietf/templates/registration/confirm.html @@ -7,7 +7,7 @@

Confirm account creation

{% if success %}

Your account with login name '{{ email }}' has been created, using the password you have selected.

-

Now you can sign in

+

Now you can sign in

{% else %}

In order to complete the setup of your account with login name '{{ email }}', please set a password:

{% csrf_token %} diff --git a/ietf/templates/registration/loggedout.html b/ietf/templates/registration/logged_out.html similarity index 100% rename from ietf/templates/registration/loggedout.html rename to ietf/templates/registration/logged_out.html