Redirect successful login to profile page if logged in from activation complete.
--- a/pytask/profile/views.py Tue Jan 18 17:34:29 2011 +0530
+++ b/pytask/profile/views.py Tue Jan 18 17:34:57 2011 +0530
@@ -204,12 +204,17 @@
# Check if the request came from logout page, if so set
# authentication to redirect to home page
- if reverse('auth_logout') == urlparse.urlsplit(
- request.META['HTTP_REFERER'])[2]:
+ referer_path = urlparse.urlsplit(request.META['HTTP_REFERER'])[2]
+ if referer_path == reverse('auth_logout'):
response = {
'authentication': 'success',
'redirect': reverse('home_page'),
}
+ elif referer_path == reverse('registration_activation_complete'):
+ response = {
+ 'authentication': 'success',
+ 'redirect': reverse('view_profile'),
+ }
else:
response = {
'authentication': 'success',