summaryrefslogtreecommitdiffstats
path: root/django_authopenid/views.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2009-08-19 21:30:15 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2009-08-19 21:30:15 -0400
commit3a4b6ad43221abc0e0ff345d9368c3348b312128 (patch)
tree2ce70a5d5fb0eab245126fab7fac628fab0cffbe /django_authopenid/views.py
parentd5449b465875ff31a28681cf961c18ba94835c15 (diff)
downloadaskbot-3a4b6ad43221abc0e0ff345d9368c3348b312128.tar.gz
askbot-3a4b6ad43221abc0e0ff345d9368c3348b312128.tar.bz2
askbot-3a4b6ad43221abc0e0ff345d9368c3348b312128.zip
added Adolfos mods, django_authopeid bug, unified traditional and OpenID login
Diffstat (limited to 'django_authopenid/views.py')
-rw-r--r--django_authopenid/views.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/django_authopenid/views.py b/django_authopenid/views.py
index 218a31a2..65d579f4 100644
--- a/django_authopenid/views.py
+++ b/django_authopenid/views.py
@@ -175,9 +175,18 @@ def signin(request,newquestion=False,newanswer=False):
form_auth = OpenidAuthForm(initial={'next':next})
if request.POST:
-
- if 'bsignin' in request.POST.keys() or 'openid_username' in request.POST.keys():
+ if 'blogin' in request.POST.keys():
+ # perform normal django authentification
+ form_auth = OpenidAuthForm(request.POST)
+ if form_auth.is_valid():
+ user_ = form_auth.get_user()
+ login(request, user_)
+ next = clean_next(form_auth.cleaned_data.get('next'))
+ print 'next stop is "%s"' % next
+ return HttpResponseRedirect(next)
+
+ elif 'bsignin' in request.POST.keys() or 'openid_username' in request.POST.keys():
form_signin = OpenidSigninForm(request.POST)
if form_signin.is_valid():
next = clean_next(form_signin.cleaned_data.get('next'))
@@ -193,14 +202,6 @@ def signin(request,newquestion=False,newanswer=False):
on_failure=signin_failure,
sreg_request=sreg_req)
- elif 'blogin' in request.POST.keys():
- # perform normal django authentification
- form_auth = OpenidAuthForm(request.POST)
- if form_auth.is_valid():
- user_ = form_auth.get_user()
- login(request, user_)
- next = clean_next(form_auth.cleaned_data.get('next'))
- return HttpResponseRedirect(next)
question = None
if newquestion == True:
@@ -368,7 +369,7 @@ def register(request):
return render('authopenid/complete.html', {
'form1': form1,
'form2': form2,
- 'provider':providers[provider_name],
+ 'provider':provider_logo,
'nickname': nickname,
'email': email
}, context_instance=RequestContext(request))