Skip to content

Commit 642ded8

Browse files
authored
Update timesketch/models/annotations.py
1 parent ebfd456 commit 642ded8

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

timesketch/models/annotations.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,20 @@ def get_status(self):
371371
if not self.status:
372372
self.status.append(self.Status(user=None, status="new"))
373373
if len(self.status) > 1:
374-
# TODO: at some point replace the waning with an exception:
375-
# raise RuntimeError("More than one status available")
376-
logging.warning("More than one status available")
377-
return self.status[0] # always return the last element in the array
374+
self_id = self.id if hasattr(self, "id") else None
375+
# TODO: Change from warning to raising an exception once we ensured
376+
# it won't affect the deployment.
377+
# raise RuntimeError(
378+
# "More than one status available for object [%s] with ID: [%s]",
379+
# str(type(self).__name__),
380+
# str(self_id)
381+
# )
382+
logging.warning(
383+
"More than one status available for object [%s] with ID: [%s]",
384+
str(type(self).__name__),
385+
str(self_id)
386+
)
387+
return self.status[0]
378388

379389

380390
class GenericAttributeMixin(object):

0 commit comments

Comments
 (0)