diff options
author | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2012-08-08 16:20:02 -0600 |
---|---|---|
committer | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2012-08-08 16:20:02 -0600 |
commit | a8962b1e0c4d11346f7019370efd3736caff3cf5 (patch) | |
tree | b254a34b0985691640d27148d8c8c2383a510a30 | |
parent | 064ee84b1fa572df5148fc6613ea0d860cb6e7e7 (diff) | |
download | askbot-a8962b1e0c4d11346f7019370efd3736caff3cf5.tar.gz askbot-a8962b1e0c4d11346f7019370efd3736caff3cf5.tar.bz2 askbot-a8962b1e0c4d11346f7019370efd3736caff3cf5.zip |
fixed next url after login
-rw-r--r-- | askbot/views/widgets.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/askbot/views/widgets.py b/askbot/views/widgets.py index e51e7288..77eb7eb5 100644 --- a/askbot/views/widgets.py +++ b/askbot/views/widgets.py @@ -1,10 +1,11 @@ from datetime import datetime -from django.views.decorators import csrf -from django.shortcuts import redirect +from django.core import exceptions from django.utils import simplejson +from django.shortcuts import redirect +from django.views.decorators import csrf from django.contrib.auth.models import User -from django.core import exceptions +from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required @@ -41,9 +42,8 @@ def ask_widget(request): return redirect('ask_by_widget_complete') else: request.session['widget_question'] = data_dict - return redirect('widget_signin') - #return redirect('user_signin', - # **{'template_name': 'authopenid/widget_signin.html'}) + next_url = '%s?next=%s' % (reverse('widget_signin'), reverse('ask_by_widget')) + return redirect(next_url) else: if 'widget_question' in request.session and \ request.GET.get('action', 'post-after-login'): @@ -55,9 +55,8 @@ def ask_widget(request): return redirect('ask_by_widget_complete') else: #FIXME: this redirect is temporal need to create the correct view - return redirect('widget_signin') - #return redirect('user_signin', - # **{'template_name': 'authopenid/widget_signin.html'}) + next_url = '%s?next=%s' % (reverse('widget_signin'), reverse('ask_by_widget')) + return redirect(next_url) form = forms.AskWidgetForm() data = {'form': form} |