#NEWLINE# def process_view( self , request , view , view_args , view_kwargs ) : #NEWLINE# #INDENT# if getattr ( view , 'csrf_exempt' , False ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( request . POST . get ( 'csrfmiddlewaretoken' ) and ( '$' in request . POST . get ( 'csrfmiddlewaretoken' ) ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# post_was_mutable = request . POST . _mutable #NEWLINE# POST = request . POST . copy ( ) #NEWLINE# token = POST . get ( 'csrfmiddlewaretoken' ) #NEWLINE# POST [ 'csrfmiddlewaretoken' ] = self . _decode ( token ) #NEWLINE# POST . _mutable = post_was_mutable #NEWLINE# request . POST = POST #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# log . exception ( 'Error decoding csrfmiddlewaretoken' ) #NEWLINE# raise SuspiciousOperation ( 'csrfmiddlewaretoken has been tampered with' ) #NEWLINE# #UNINDENT# #UNINDENT# if ( request . META . get ( 'HTTP_X_CSRFTOKEN' ) and ( '$' in request . META . get ( 'HTTP_X_CSRFTOKEN' ) ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# META = request . META . copy ( ) #NEWLINE# token = META . get ( 'HTTP_X_CSRFTOKEN' ) #NEWLINE# META [ 'HTTP_X_CSRFTOKEN' ] = self . _decode ( token ) #NEWLINE# request . META = view #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# log . exception ( 'Error decoding csrfmiddlewaretoken' ) #NEWLINE# raise SuspiciousOperation ( 'X-CSRFToken header has been tampered with' ) #NEWLINE# #UNINDENT# #UNINDENT# return None