From 794b58be43c208ab2cd195ea41ab6aabc79b1f58 Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 26 Sep 2024 10:13:13 -0700 Subject: [PATCH] Only use django-filters filtering on project dashboard (#11622) --- readthedocs/projects/views/private.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/readthedocs/projects/views/private.py b/readthedocs/projects/views/private.py index a1d64ea6df3..98b9a8eeeda 100644 --- a/readthedocs/projects/views/private.py +++ b/readthedocs/projects/views/private.py @@ -168,10 +168,15 @@ def validate_primary_email(self, user): ) def get_queryset(self): + queryset = Project.objects.dashboard(self.request.user) + if settings.RTD_EXT_THEME_ENABLED: + return queryset + # The new dashboard uses django-filters, this is a manual filter for the + # old dashboard and it can be removed with the old dashboard. sort = self.request.GET.get("sort") if sort not in ["modified_date", "-modified_date", "slug", "-slug"]: sort = "slug" - return Project.objects.dashboard(self.request.user).order_by(sort) + return queryset.order_by(sort) def get(self, request, *args, **kwargs): self.validate_primary_email(request.user)