Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnesbitt committed Jul 27, 2022
1 parent 3a0aa81 commit ac03c6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dandiapi/api/views/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,12 @@ def list(self, request, *args, **kwargs):
serializer = AssetListSerializer(data=request.query_params)
serializer.is_valid(raise_exception=True)

# Don't include metadata field if not asked for
# Fetch initial queryset
queryset: QuerySet[Asset] = self.filter_queryset(
self.get_queryset().select_related('blob', 'embargoed_blob', 'zarr')
)

# Don't include metadata field if not asked for
include_metadata = serializer.validated_data['metadata']
if not include_metadata:
queryset = queryset.defer('metadata')
Expand Down

0 comments on commit ac03c6a

Please sign in to comment.