Skip to content

Commit

Permalink
Update Resource query in filter_by_checksums #551
Browse files Browse the repository at this point in the history
Signed-off-by: Jono Yang <[email protected]>
  • Loading branch information
JonoYang committed Dec 3, 2024
1 parent ad5f579 commit b7bb053
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) nexB Inc. and others. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

FROM --platform=linux/amd64 python:3.12-slim
FROM python:3.12-slim

LABEL org.opencontainers.image.source="https://github.com/aboutcode-org/purldb"
LABEL org.opencontainers.image.description="PurlDB"
Expand Down
2 changes: 1 addition & 1 deletion packagedb/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def filter_by_checksums(self, request, *args, **kwargs):
d = {f"{field}__in": value}
lookups |= Q(**d)

qs = Resource.objects.filter(lookups).prefetch_related("package")
qs = Resource.objects.filter(lookups).select_related("package").defer("package__history")
paginated_qs = self.paginate_queryset(qs)
serializer = ResourceAPISerializer(
paginated_qs, many=True, context={"request": request}
Expand Down

0 comments on commit b7bb053

Please sign in to comment.