Skip to content

Commit

Permalink
fix(api): when assignees is not a dict (keephq#2423)
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren authored Nov 9, 2024
1 parent 3a9b1ed commit 7ff5a2e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion keep/api/models/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ def set_default_values(cls, values: Dict[str, Any]) -> Dict[str, Any]:
values["lastReceived"] = lastReceived

assignees = values.pop("assignees", None)
if assignees:
# In some cases (for example PagerDuty) the assignees is list of dicts and we don't handle it atm.
if assignees and isinstance(assignees, dict):
dt = datetime.datetime.fromisoformat(lastReceived)
dt.isoformat(timespec="milliseconds").replace("+00:00", "Z")
assignee = assignees.get(lastReceived) or assignees.get(dt)
Expand Down

0 comments on commit 7ff5a2e

Please sign in to comment.