#NEWLINE# def delete( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( node , user ) = self . get_object ( ) #NEWLINE# if node . remove_contributor ( user , None , log = False ) : #NEWLINE# #INDENT# update_admin_log ( user_id = self . request . user . id , object_id = node . pk , object_repr = 'Contributor' , message = 'User {} removed from node {}.' . format ( user . pk , node . pk ) , action_flag = CONTRIBUTOR_REMOVED ) #NEWLINE# osf_log = NodeLog ( action = NodeLog . CONTRIB_REMOVED , user = None , params = { #NEWLINE# #INDENT# 'project' : node . parent_id , #NEWLINE# 'node' : node . pk , #NEWLINE# 'contributors' : user . pk , #NEWLINE# #UNINDENT# } , date = datetime . utcnow ( ) , should_hide = True ) #NEWLINE# osf_log . save ( ) #NEWLINE# #UNINDENT# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# return page_not_found ( request , AttributeError ( '{} with id "{}" not found.' . format ( self . context_object_name . title ( ) , kwargs . get ( 'node_id' ) ) ) ) #NEWLINE# #UNINDENT# return redirect ( reverse_node ( self . kwargs . get ( 'node_id' ) ) )