A new view for processing post login to give the right html to replace for user action right sidebar.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Tue, 18 Jan 2011 01:20:07 +0530
changeset 453 4b4e299add3b
parent 452 f10fe304298c
child 454 8d88ec95a828
A new view for processing post login to give the right html to replace for user action right sidebar.
pytask/profile/urls.py
pytask/profile/views.py
pytask/settings.py
--- a/pytask/profile/urls.py	Tue Jan 18 01:19:41 2011 +0530
+++ b/pytask/profile/urls.py	Tue Jan 18 01:20:07 2011 +0530
@@ -17,4 +17,5 @@
       'unread_notification', name='unread_notification'),
   url(r'^user/view/(?P<user_id>\d+)$', 'view_user',
       name='view_user'),
+  url(r'^login/proceed$', 'login_proceed', name='login_proceed'),
 )
--- a/pytask/profile/views.py	Tue Jan 18 01:19:41 2011 +0530
+++ b/pytask/profile/views.py	Tue Jan 18 01:20:07 2011 +0530
@@ -190,4 +190,20 @@
                "can_view_info": can_view_info,
               }
 
-    return shortcuts.render_to_response("profile/view_user.html", context)
+    return shortcuts.render_to_response("profile/view_user.html",
+                                        RequestContext(request, context))
+
+@login_required
+def login_proceed(request):
+  """View that handles the successful login.
+  """
+
+  template_name = '_user_login.html'
+  response = {
+    'authentication': 'success',
+    'markup': loader.render_to_string(template_name,
+                                      RequestContext(request, {}))
+  }
+
+  json_response = json.dumps(response)
+  return http.HttpResponse(json_response)
--- a/pytask/settings.py	Tue Jan 18 01:19:41 2011 +0530
+++ b/pytask/settings.py	Tue Jan 18 01:20:07 2011 +0530
@@ -103,4 +103,5 @@
 #django-registration
 ACCOUNT_ACTIVATION_DAYS = 7
 DEFAULT_FROM_EMAIL = 'FOSSEE Admin <admin@fossee.in>'
-LOGIN_REDIRECT_URL = '/'
+
+LOGIN_REDIRECT_URL = '/profile/login/proceed'