#NEWLINE# def process_response( self , request , response ) : #NEWLINE# #INDENT# if ( response . status_code != 404 ) : #NEWLINE# #INDENT# return response #NEWLINE# #UNINDENT# full_path = request . get_full_path ( ) #NEWLINE# current_site = get_current_site ( request ) #NEWLINE# r = None #NEWLINE# try : #NEWLINE# #INDENT# r = Redirect . objects . get ( site = current_site , old_path = full_path ) #NEWLINE# #UNINDENT# except Redirect . DoesNotExist : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# if ( ( r is None ) and settings . APPEND_SLASH and ( not request . path . endswith ( '/' ) ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# r = Redirect . objects . get ( site = current_site , old_path = request . get_full_path ( force_append_slash = True ) ) #NEWLINE# #UNINDENT# except Redirect . DoesNotExist : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# if ( r is not None ) : #NEWLINE# #INDENT# if ( r . new_path == '' ) : #NEWLINE# #INDENT# return self . response_gone_class ( ) #NEWLINE# #UNINDENT# return self . response_redirect_class ( r . new_path ) #NEWLINE# #UNINDENT# return response