def complete(request, backend, *args, **kwargs): """Authentication complete view, override this view if transaction management doesn't suit your needs.""" if request.user.is_authenticated(): return associate_complete(request, backend, *args, **kwargs) else: return complete_process(request, backend, *args, **kwargs)
def associate_complete_wrapper(request, backend): try: return associate_complete(request, backend) except ValueError, e: if e and len(e.args) > 0: if e[0] == 'Account already in use.': messages.error(request, "Authentication already used on account: %s" % e[1])
def login_done(request, backend, *args, **kwargs): if request.user.is_authenticated(): return associate_complete(request, backend, *args, **kwargs) else: try: return complete_process(request, backend, *args, **kwargs) except Exception, e: logger.exception(e) return html_response('login.html', {'at_login': True, 'error': str(e)}, request)
def socialauth_complete(request, backend, *args, **kwargs): """ Authentication complete process -- override from the default in django-social-auth to: -- collect phone numbers on registration -- integrate with django-registration in order to confirm email for new users """ if request.user.is_authenticated(): return sviews.associate_complete(request, backend, *args, **kwargs) else: return complete_process(request, backend, *args, **kwargs)