def weblate_login(request):
 if request.user.is_authenticated():
  return redirect_profile()
 auth_backends = list(load_backends(BACKENDS).keys())
 if ((len(auth_backends) == 1) and (auth_backends[0] != u'email')):
  return redirect(u'social:begin', auth_backends[0])
 return auth_views.login(request, template_name=u'accounts/login.html', authentication_form=LoginForm, extra_context={u'login_backends': [x for x in auth_backends if (x != u'email')], u'can_reset': (u'email' in auth_backends), u'title': _(u'Login')})

def weblate_login ( request ) : if request . user . is_authenticated ( ) : return redirect_profile ( ) auth_backends = list ( load_backends ( BACKENDS ) . keys ( ) ) if ( ( len ( auth_backends ) == 1 ) and ( auth_backends [ 0 ] != u'email' ) ) : return redirect ( u'social:begin' , auth_backends [ 0 ] ) return auth_views . login ( request , template_name = u'accounts/login.html' , authentication_form = LoginForm , extra_context = { u'login_backends' : [ x for x in auth_backends if ( x != u'email' ) ] , u'can_reset' : ( u'email' in auth_backends ) , u'title' : _ ( u'Login' ) } )
login handler .