Skip to content

Commit

Permalink
perf: 修改 asset get queryset
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuler committed Jan 10, 2025
1 parent 96dc7db commit a0563b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/assets/api/asset/asset.py
Original file line number Diff line number Diff line change
@@ -116,7 +116,8 @@ class AssetViewSet(SuggestionMixin, OrgBulkModelViewSet):

def get_queryset(self):
queryset = super().get_queryset()
if queryset.model is not Asset:
if queryset.model.__name__ != 'Asset':
print("get query prefetch")
queryset = queryset.select_related('asset_ptr')
return queryset

0 comments on commit a0563b8

Please sign in to comment.