summaryrefslogtreecommitdiffstats
path: root/django_authopenid/views.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2009-08-19 21:29:51 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2009-08-19 21:29:51 -0400
commit2022b772a01f36fa74de002b5370dd70b6c051ba (patch)
tree2ce70a5d5fb0eab245126fab7fac628fab0cffbe /django_authopenid/views.py
parent1bc0d490820c4587a8902747e8516aa6ae98a515 (diff)
downloadaskbot-2022b772a01f36fa74de002b5370dd70b6c051ba.tar.gz
askbot-2022b772a01f36fa74de002b5370dd70b6c051ba.tar.bz2
askbot-2022b772a01f36fa74de002b5370dd70b6c051ba.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))