Skip to content

Commit

Permalink
minor mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Mar 15, 2023
1 parent 2c6c6ca commit b2fdf73
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ def _by_created_dt(task: Task) -> datetime.datetime:
# NOTE: SAFE implementation to extract task.CreatedAt as datetime for comparison
if task.CreatedAt:
with suppress(ValueError):
return to_datetime(task.CreatedAt).replace(tzinfo=datetime.timezone.utc)
created_at = to_datetime(task.CreatedAt)
created_at_utc: datetime.datetime = created_at.replace(
tzinfo=datetime.timezone.utc
)
return created_at_utc
return datetime.datetime.now(datetime.timezone.utc)


Expand Down

0 comments on commit b2fdf73

Please sign in to comment.