Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
[fix bug 810992] Redirect to ?next= page after login.
Browse files Browse the repository at this point in the history
  • Loading branch information
glogiotatidis committed Nov 15, 2012
1 parent fa114ce commit 543ade2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions apps/api/paginator.py
@@ -1,7 +1,6 @@
from django.conf import settings

from tastypie import paginator
from tastypie.exceptions import BadRequest


class Paginator(paginator.Paginator):
Expand All @@ -22,7 +21,6 @@ def get_limit(self):
hard_limit = getattr(settings, 'HARD_API_LIMIT_PER_PAGE', 500)
return min(super(Paginator, self).get_limit(), hard_limit)


def get_offset(self):
"""Determines the proper starting offset of results to return.
Expand Down
3 changes: 1 addition & 2 deletions apps/users/views.py
Expand Up @@ -38,8 +38,7 @@ def login_success(self):
log.warning('Created profile for user with email %s' % user.email)

if profile.is_complete():
auth.login(self.request, self.user)
return redirect(reverse('home'))
return super(BrowserID, self).login_success()

self.request.session['authenticated_email'] = user.email
return redirect(reverse('register'))
Expand Down
2 changes: 2 additions & 0 deletions templates/base.html
Expand Up @@ -172,6 +172,8 @@
<form method="POST" class="browserid_action_form" action="{{ url('browserid_verify') }}">
{{ csrf() }}
{{ browserid_form.as_p() }}
<input type="hidden" name="next"
value="{{ request.REQUEST.next|default(settings.LOGIN_REDIRECT_URL) }}" />
</form>
{% endif %}
{% endblock %}
Expand Down

0 comments on commit 543ade2

Please sign in to comment.