Skip to content

Commit

Permalink
fixed mypy issues
Browse files Browse the repository at this point in the history
Signed-off-by: Trey <[email protected]>
  • Loading branch information
TreyWW committed Oct 2, 2024
1 parent 370539d commit 10275a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/service/maintenance/expire/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ def expire_and_cleanup_objects() -> str:

for model in model_list:
# Delete objects that have been inactive and expired for more than 14 days
over_14_days_expired: QuerySet[models.Model] = model.all_objects.filter(expires__lte=now - timedelta(days=14))
over_14_days_expired: QuerySet[models.Model] = model.all_objects.filter(
expires__lte=now - timedelta(days=14)
) # type: ignore[attr-defined]
deleted_items += over_14_days_expired.count()
over_14_days_expired.delete()

# Deactivate expired items that got missed
to_deactivate: QuerySet[models.Model] = model.all_objects.filter(expires__lte=now, active=True)
to_deactivate: QuerySet[models.Model] = model.all_objects.filter(expires__lte=now, active=True) # type: ignore[attr-defined]

deactivated_items += to_deactivate.count()
to_deactivate.update(active=False)
Expand Down

0 comments on commit 10275a8

Please sign in to comment.