With the complications caused by the TransactionMiddleware gone, we can use Django's default login() and logout() views.
- Legacy-Id: 7539
This commit is contained in:
parent
29fe2e87ea
commit
5549088331
|
@ -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<user>[a-z0-9.@]+)/(?P<passwd>.+)$', 'url_login'),
|
||||
url(r'^testemail/$', 'test_email'),
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<h1>Change password</h1>
|
||||
{% if success %}
|
||||
<p>Your password has been updated.</p>
|
||||
<p>Now you can <a href="{% url "ietfauth.views.ietf_login" %}">sign in</a></p>
|
||||
<p>Now you can <a href="/accounts/login/">sign in</a></p>
|
||||
{% else %}
|
||||
<p>Hello, you can select a new password below for your user {{ username }}.</p>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<h1>Confirm account creation</h1>
|
||||
{% if success %}
|
||||
<p>Your account with login name '{{ email }}' has been created, using the password you have selected.</p>
|
||||
<p>Now you can <a href="{% url "ietfauth.views.ietf_login" %}">sign in</a></p>
|
||||
<p>Now you can <a href="/accounts/login/">sign in</a></p>
|
||||
{% else %}
|
||||
<p>In order to complete the setup of your account with login name '{{ email }}', please set a password:</p>
|
||||
<form action="" method="post">{% csrf_token %}
|
||||
|
|
Loading…
Reference in a new issue