Redirect successful login to profile page if logged in from activation complete.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Tue, 18 Jan 2011 17:34:57 +0530
changeset 464 6f5a60ce7d25
parent 463 c7c595c0bed3
child 465 14a7648a8699
Redirect successful login to profile page if logged in from activation complete.
pytask/profile/views.py
--- 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',