Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[fix bug 810992] Redirect to ?next= page after login.

  • Loading branch information...
commit 543ade2202a8848daa37e79c323e451fe08d0fe9 1 parent fa114ce
Giorgos Logiotatidis authored November 15, 2012
2  apps/api/paginator.py
... ...
@@ -1,7 +1,6 @@
1 1
 from django.conf import settings
2 2
 
3 3
 from tastypie import paginator
4  
-from tastypie.exceptions import BadRequest
5 4
 
6 5
 
7 6
 class Paginator(paginator.Paginator):
@@ -22,7 +21,6 @@ def get_limit(self):
22 21
         hard_limit = getattr(settings, 'HARD_API_LIMIT_PER_PAGE', 500)
23 22
         return min(super(Paginator, self).get_limit(), hard_limit)
24 23
 
25  
-
26 24
     def get_offset(self):
27 25
         """Determines the proper starting offset of results to return.
28 26
 
3  apps/users/views.py
@@ -38,8 +38,7 @@ def login_success(self):
38 38
             log.warning('Created profile for user with email %s' % user.email)
39 39
 
40 40
         if profile.is_complete():
41  
-            auth.login(self.request, self.user)
42  
-            return redirect(reverse('home'))
  41
+            return super(BrowserID, self).login_success()
43 42
 
44 43
         self.request.session['authenticated_email'] = user.email
45 44
         return redirect(reverse('register'))
2  templates/base.html
@@ -172,6 +172,8 @@
172 172
     <form method="POST" class="browserid_action_form" action="{{ url('browserid_verify') }}">
173 173
       {{ csrf() }}
174 174
       {{ browserid_form.as_p() }}
  175
+      <input type="hidden" name="next"
  176
+             value="{{ request.REQUEST.next|default(settings.LOGIN_REDIRECT_URL) }}" />
175 177
     </form>
176 178
   {% endif %}
177 179
 {% endblock %}

0 notes on commit 543ade2

Please sign in to comment.
Something went wrong with that request. Please try again.