perf: 账号生成时,排除 [ 开头的

This commit is contained in:
ibuler
2023-08-10 18:23:53 +08:00
parent e416a5d5d7
commit e9e5fbb4c2
7 changed files with 36 additions and 25 deletions

View File

@@ -47,11 +47,9 @@ class UserGroupGrantedAssetsApi(ListAPIView):
granted_q |= Q(granted_by_permissions__id__in=asset_perm_ids)
assets = Asset.objects.filter(
granted_q
).distinct().only(
*self.only_fields
)
assets = Asset.objects.filter(granted_q) \
.only(*self.only_fields) \
.distinct()
return assets