Skip to content
Snippets Groups Projects
Verified Commit 3033db56 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Reformat function body and remove stray debug print

parent fd94c885
No related branches found
No related tags found
1 merge request!477Resolve "Handle broken DashboardWidgets correctly"
Pipeline #10331 failed
......@@ -106,9 +106,10 @@ class InstalledWidgetsDashBoardWidgetOrderManager(Manager):
"""A custom manager that only returns DashboardWidgetOrder objects with an existing dashboard widget"""
def get_queryset(self):
queryset = super().get_queryset()
# Get the DashboardWidget model class without importing it to avoid a circular import
DashboardWidget = queryset.model.widget.field.related_model # noqa
dashboard_widget_pks = DashboardWidget.objects.all().values("id")
print(dashboard_widget_pks)
# [obj["id"] for obj in list(Person.objects.all().values("id"))]
return super().get_queryset().filter(widget_id__in=dashboard_widget_pks)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment