#NEWLINE# def update_position_history( request , obj , position , action , message = None ) : #NEWLINE# #INDENT# ' Update position history if turned on ' #NEWLINE# if ( not position_settings . UPDATE_POSITION_HISTORY ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( obj and ( not message ) ) : #NEWLINE# #INDENT# if ( action == ADDITION ) : #NEWLINE# #INDENT# action_message = 'added' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( action == DELETION ) : #NEWLINE# #INDENT# action_message = 'removed' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# action_message = 'changed' #NEWLINE# #UNINDENT# #UNINDENT# message = ( 'Position Content %s was %s.' % ( obj , position ) ) #NEWLINE# #UNINDENT# if ( not message ) : #NEWLINE# #INDENT# 'Empty message.' #NEWLINE# #UNINDENT# LogEntry . objects . log_action ( user_id = request . user . pk , content_type_id = ContentType . objects . get_for_model ( position ) . pk , object_id = position . pk , object_repr = force_unicode ( position ) , action_flag = action , change_message = message )