diff options
Diffstat (limited to 'django_authopenid/util.py')
-rw-r--r-- | django_authopenid/util.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/django_authopenid/util.py b/django_authopenid/util.py index 54c1246b..edb6808e 100644 --- a/django_authopenid/util.py +++ b/django_authopenid/util.py @@ -7,7 +7,7 @@ import openid.store from django.db.models.query import Q from django.conf import settings from django.http import str_to_unicode - +from django.core.urlresolvers import reverse # needed for some linux distributions like debian try: @@ -22,7 +22,7 @@ from models import Association, Nonce __all__ = ['OpenID', 'DjangoOpenIDStore', 'from_openid_response', 'clean_next'] -DEFAULT_NEXT = getattr(settings, 'OPENID_REDIRECT_NEXT', '/') +DEFAULT_NEXT = '/' + getattr(settings, 'FORUM_SCRIPT_ALIAS') def clean_next(next): if next is None: return DEFAULT_NEXT @@ -32,6 +32,9 @@ def clean_next(next): return next return DEFAULT_NEXT +def get_next_url(request): + return clean_next(request.REQUEST.get('next')) + class OpenID: def __init__(self, openid_, issued, attrs=None, sreg_=None): self.openid = openid_ |