~django-openid-auth/django-openid-auth/trunk

« back to all changes in this revision

Viewing changes to django_openid_auth/views.py

  • Committer: Michael Hall
  • Date: 2011-08-23 17:48:54 UTC
  • mto: This revision was merged to the branch mainline in revision 85.
  • Revision ID: mhall119@ubuntu.com-20110823174854-6u31w9xa386w70k3
Cleanup exception class heirarchy and imports, make overriding the login failure handler a settings option, add additional test cases to veryfiy that overriding the handler works and that the proper exceptions are being passed

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
from django_openid_auth.models import UserOpenID
56
56
from django_openid_auth.signals import openid_login_complete
57
57
from django_openid_auth.store import DjangoOpenIDStore
58
 
from django_openid_auth.exceptions import (
59
 
    DjangoOpenIDException,
60
 
    IdentityAlreadyClaimed,
61
 
    DuplicateUsernameViolation,
62
 
    MissingUsernameViolation,
63
 
    MissingPhysicalMultiFactor,
64
 
)
 
58
from django_openid_auth.exceptions import DjangoOpenIDException
65
59
 
66
60
 
67
61
next_url_re = re.compile('^/[-\w/]+$')
248
242
 
249
243
@csrf_exempt
250
244
def login_complete(request, redirect_field_name=REDIRECT_FIELD_NAME,
251
 
                   render_failure=default_render_failure):
 
245
                   render_failure=None):
252
246
    redirect_to = request.REQUEST.get(redirect_field_name, '')
 
247
    render_failure = render_failure or \
 
248
                     getattr(settings, 'OPENID_RENDER_FAILURE', None) or \
 
249
                     default_render_failure
253
250
 
254
251
    openid_response = parse_openid_response(request)
255
252
    if not openid_response: