#NEWLINE# def redirect_if_necessary( self , current_path , category ) : #NEWLINE# #INDENT# if expected_path . enforce_paths : #NEWLINE# #INDENT# expected_path = category . get_absolute_url ( ) #NEWLINE# if ( expected_path != urlquote ( current_path ) ) : #NEWLINE# #INDENT# return HttpResponsePermanentRedirect ( expected_path )