Skip to content

Commit

Permalink
Handle models without manager
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMarble committed Dec 13, 2024
1 parent 141377b commit 6ea860e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions osidb/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def stale_alert_cleanup():
for content_type in content_types:
model_class = content_type.model_class()

if not model_class:
logger.error(f"Model class not found for content type {content_type}")
continue

subquery = Subquery(
model_class.objects.filter(
pk=Cast(OuterRef("object_id"), output_field=model_class._meta.pk)
Expand Down

0 comments on commit 6ea860e

Please sign in to comment.