mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-16 20:08:09 +00:00
add Timestamp to multiple models (#796)
Expose the Azure storage table's "Timestamp" for the models where Timestamp should be user-accessible and remove the Timestamp field from models that did not sign up for it. The behavior where Timestamp is only set by Azure Storage is kept.
This commit is contained in:
@ -17,12 +17,12 @@ class TaskEvent(BASE_TASK_EVENT, ORMMixin):
|
||||
@classmethod
|
||||
def get_summary(cls, task_id: UUID) -> List[TaskEventSummary]:
|
||||
events = cls.search(query={"task_id": [task_id]})
|
||||
# handle None case of Optional[e.Timestamp], which shouldn't happen
|
||||
events.sort(key=lambda e: e.Timestamp or datetime.datetime.max)
|
||||
# handle None case of Optional[e.timestamp], which shouldn't happen
|
||||
events.sort(key=lambda e: e.timestamp or datetime.datetime.max)
|
||||
|
||||
return [
|
||||
TaskEventSummary(
|
||||
timestamp=e.Timestamp,
|
||||
timestamp=e.timestamp,
|
||||
event_data=get_event_data(e.event_data),
|
||||
event_type=get_event_type(e.event_data),
|
||||
)
|
||||
|
Reference in New Issue
Block a user