Skip to content

Commit

Permalink
Use objects manager in graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
hipek8 committed Oct 2, 2024
1 parent 9791949 commit 4d0c405
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions src/ralph/dashboards/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,7 @@ def _default_aggregation_handler(
)

def build_queryset(self, annotated=True, queryset=None):
model = self.model.model_class()
model_manager = model._default_manager
queryset = queryset or model_manager.all()
queryset = queryset or self.model.model_class().objects.all()

grouping_label = GroupingLabel(connection, self.params['labels'])
if annotated:
Expand Down
1 change: 0 additions & 1 deletion src/ralph/licences/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ class Licence(Regionalizable, AdminAbsoluteUrlMixin, PriceMixin, BaseObject):
)
)

objects = models.Manager()
polymorphic_objects = PolymorphicQuerySet.as_manager()
objects_used_free = LicencesUsedFreeManager()
objects_with_related = LicencesRelatedObjectsManager()
Expand Down

0 comments on commit 4d0c405

Please sign in to comment.