#NEWLINE# def get_requirement_redirect( self , request , default = None ) : #NEWLINE# #INDENT# 'Returns the location which a user should be redirected to after fulfilling a requirement (like logging in).' #NEWLINE# redirect = request . session . pop ( 'requirement_redirect' , None ) #NEWLINE# if ( ( not redirect ) or ( ' ' in redirect ) ) : #NEWLINE# #INDENT# redirect = default #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# netloc = urlparse . urlparse ( redirect ) [ 1 ] #NEWLINE# if ( netloc and ( netloc != request . get_host ( ) ) ) : #NEWLINE# #INDENT# redirect = default #NEWLINE# #UNINDENT# #UNINDENT# if ( redirect is None ) : #NEWLINE# #INDENT# redirect = request . node . get_absolute_url ( ) #NEWLINE# #UNINDENT# return redirect