File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -47,27 +47,31 @@ def _do_cleanup(self, wr):
4747
4848
4949def add_obj_history_entry (obj , action , commit = False ):
50- if hasattr (obj , 'modification_history' ):
50+ date_update = datetime .datetime .now (datetime .timezone .utc )
51+ timestamp = date_update .timestamp ()
52+ utc = date_update
5153
54+ if hasattr (obj , 'modification_history' ):
5255 if isinstance (obj .modification_history , dict ):
53-
5456 obj .modification_history .update ({
55- datetime . datetime . now (). timestamp () : {
57+ timestamp : {
5658 'user' : iris_current_user .user ,
5759 'user_id' : iris_current_user .id ,
5860 'action' : action
5961 }
6062 })
61-
6263 else :
63-
6464 obj .modification_history = {
65- datetime . datetime . now (). timestamp () : {
65+ timestamp : {
6666 'user' : iris_current_user .user ,
6767 'user_id' : iris_current_user .id ,
6868 'action' : action
6969 }
7070 }
71+
72+ if hasattr (obj , 'date_update' ):
73+ obj .date_update = utc
74+
7175 flag_modified (obj , "modification_history" )
7276 if commit :
7377 db .session .commit ()
You can’t perform that action at this time.
0 commit comments