#NEWLINE# @ mod . route ( '/login/' , methods = [ 'GET' , 'POST' ] ) #NEWLINE# @ oid . loginhandler #NEWLINE# def login( ) : #NEWLINE# #INDENT# if ( g . user is not None ) : #NEWLINE# #INDENT# return redirect ( url_for ( 'general.index' ) ) #NEWLINE# #UNINDENT# if ( 'cancel' in request . form ) : #NEWLINE# #INDENT# flash ( 'Cancelled. The OpenID was not changed.' ) #NEWLINE# return redirect ( oid . get_next_url ( ) ) #NEWLINE# #UNINDENT# openid = request . values . get ( 'openid' ) #NEWLINE# if ( not openid ) : #NEWLINE# #INDENT# openid = COMMON_PROVIDERS . get ( request . args . get ( 'provider' ) ) #NEWLINE# #UNINDENT# if openid : #NEWLINE# #INDENT# return oid . try_login ( error , ask_for = [ 'fullname' , 'nickname' ] ) #NEWLINE# #UNINDENT# error = oid . fetch_error ( ) #NEWLINE# if error : #NEWLINE# #INDENT# flash ( ( 'Error: ' + error ) ) #NEWLINE# #UNINDENT# return render_template ( 'general/login.html' , next = oid . get_next_url ( ) )