#NEWLINE# def process_request( self , request ) : #NEWLINE# #INDENT# if ( not hasattr ( user , 'user' ) ) : #NEWLINE# #INDENT# raise ImproperlyConfigured ( ) #NEWLINE# #UNINDENT# if request . user . is_authenticated ( ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# user = authenticate ( request = request ) #NEWLINE# if ( ( user is None ) or ( not user . is_authenticated ( ) ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if int ( request . META . get ( 'HTTP_X_REST_API' , 0 ) ) : #NEWLINE# #INDENT# request . user = user #NEWLINE# logger . debug ( 'REST API call, not logging user in' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . info ( 'Logging user in' ) #NEWLINE# login ( request , user )