git.ithinksw.org
/
philo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
be58b3e
)
Fixed login redirects
author
Stephen Burrows
<stephen.r.burrows@gmail.com>
Wed, 15 Sep 2010 20:59:56 +0000
(16:59 -0400)
committer
Stephen Burrows
<stephen.r.burrows@gmail.com>
Thu, 23 Sep 2010 16:31:55 +0000
(12:31 -0400)
contrib/waldo/models.py
patch
|
blob
|
history
diff --git
a/contrib/waldo/models.py
b/contrib/waldo/models.py
index
83724f4
..
65cba9e
100644
(file)
--- a/
contrib/waldo/models.py
+++ b/
contrib/waldo/models.py
@@
-81,7
+81,7
@@
class LoginMultiView(MultiView):
if host != request.get_host():
referrer = None
else:
if host != request.get_host():
referrer = None
else:
- redirect = '
'.join(referrer[2:
])
+ redirect = '
%s?%s' % (referrer[2], referrer[4
])
if referrer is None:
redirect = node.get_absolute_url()
if referrer is None:
redirect = node.get_absolute_url()
@@
-107,6
+107,9
@@
class LoginMultiView(MultiView):
"""
Displays the login form for the given HttpRequest.
"""
"""
Displays the login form for the given HttpRequest.
"""
+ if request.user.is_authenticated():
+ return HttpResponseRedirect(node.get_absolute_url())
+
context = self.get_context(extra_context)
from django.contrib.auth.models import User
context = self.get_context(extra_context)
from django.contrib.auth.models import User
@@
-177,6
+180,9
@@
class LoginMultiView(MultiView):
send_mail(subject, message, from_email, [email])
def password_reset(self, request, node=None, extra_context=None, token_generator=password_token_generator):
send_mail(subject, message, from_email, [email])
def password_reset(self, request, node=None, extra_context=None, token_generator=password_token_generator):
+ if request.user.is_authenticated():
+ return HttpResponseRedirect(node.get_absolute_url())
+
if request.method == 'POST':
form = PasswordResetForm(request.POST)
if form.is_valid():
if request.method == 'POST':
form = PasswordResetForm(request.POST)
if form.is_valid():