#NEWLINE# def login( self ) : #NEWLINE# #INDENT# error = None #NEWLINE# Form = self . get_login_form ( ) #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# form = Form ( request . form ) #NEWLINE# next_url = ( request . form . get ( 'next' ) or self . default_next_url ) #NEWLINE# if form . validate ( ) : #NEWLINE# #INDENT# authenticated_user = self . authenticate ( form . username . data , form . password . data ) #NEWLINE# if authenticated_user : #NEWLINE# #INDENT# self . login_user ( authenticated_user ) #NEWLINE# return redirect ( next_url ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# flash ( 'Incorrect username or password' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = Form ( ) #NEWLINE# next_url = request . args . get ( 'next' ) #NEWLINE# #UNINDENT# return render_template ( 'auth/login.html' , error = authenticated_user , form = form , login_url = url_for ( ( '%s.login' % self . blueprint . name ) ) , next = next_url )