From 6ea860e48a3ba73bac082930f90ee28a0788d356 Mon Sep 17 00:00:00 2001 From: Alvaro Tinoco Date: Fri, 13 Dec 2024 12:52:01 +0100 Subject: [PATCH] Handle models without manager --- osidb/tasks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osidb/tasks.py b/osidb/tasks.py index 95cb32e97..a6afa00ed 100644 --- a/osidb/tasks.py +++ b/osidb/tasks.py @@ -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)