@@ -36,9 +36,6 @@ def _update_object_state(object_name, caseid, userid) -> ObjectState:
3636 Returns:
3737 ObjectState object
3838 """
39- if not userid :
40- userid = iris_current_user .id
41-
4239 os = ObjectState .query .filter (and_ (
4340 ObjectState .object_name == object_name ,
4441 ObjectState .object_case_id == caseid
@@ -83,6 +80,8 @@ def delete_case_states(caseid):
8380
8481
8582def update_timeline_state (caseid , userid = None ):
83+ if not userid :
84+ userid = iris_current_user .id
8685 return _update_object_state ('timeline' , caseid , userid )
8786
8887
@@ -91,6 +90,8 @@ def get_timeline_state(caseid):
9190
9291
9392def update_tasks_state (caseid , userid = None ):
93+ if not userid :
94+ userid = iris_current_user .id
9495 return _update_object_state ('tasks' , caseid , userid )
9596
9697
@@ -99,6 +100,8 @@ def get_tasks_state(caseid):
99100
100101
101102def update_evidences_state (caseid , userid = None ):
103+ if not userid :
104+ userid = iris_current_user .id
102105 return _update_object_state ('evidences' , caseid , userid )
103106
104107
@@ -107,6 +110,8 @@ def get_evidences_state(caseid):
107110
108111
109112def update_ioc_state (caseid , userid = None ):
113+ if not userid :
114+ userid = iris_current_user .id
110115 return _update_object_state ('ioc' , caseid , userid )
111116
112117
@@ -115,6 +120,8 @@ def get_ioc_state(caseid):
115120
116121
117122def update_assets_state (caseid , userid = None ):
123+ if not userid :
124+ userid = iris_current_user .id
118125 return _update_object_state ('assets' , caseid , userid )
119126
120127
@@ -123,6 +130,8 @@ def get_assets_state(caseid):
123130
124131
125132def update_notes_state (caseid , userid = None ):
133+ if not userid :
134+ userid = iris_current_user .id
126135 return _update_object_state ('notes' , caseid , userid )
127136
128137
0 commit comments