Skip to content

Commit

Permalink
allow for both the old , way and the new way
Browse files Browse the repository at this point in the history
  • Loading branch information
hblankenship committed Jan 16, 2025
1 parent 948a4e8 commit 4899e27
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dojo/api_v2/prefetch/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

class PrefetchListMixin(ListModelMixin):
def list(self, request, *args, **kwargs):
prefetch_params = request.GET.getlist("prefetch")
prefetch_params = request.GET.get("prefetch", "")
prefetch_params = prefetch_params.split(",") if "," in prefetch_params else request.GET.getlist("prefetch")

prefetcher = _Prefetcher()

# Apply the same operations as the standard list method defined in the
Expand All @@ -30,7 +32,9 @@ def list(self, request, *args, **kwargs):

class PrefetchRetrieveMixin(RetrieveModelMixin):
def retrieve(self, request, *args, **kwargs):
prefetch_params = request.GET.getlist("prefetch")
prefetch_params = request.GET.get("prefetch", "")
prefetch_params = prefetch_params.split(",") if "," in prefetch_params else request.GET.getlist("prefetch")

prefetcher = _Prefetcher()

entry = self.get_object()
Expand Down

0 comments on commit 4899e27

Please sign in to comment.