Commit 3c981419 authored by ibuler's avatar ibuler

[Update] 修改缩进

parent 785b375f
......@@ -124,15 +124,14 @@ class AssetPermissionViewSet(viewsets.ModelViewSet):
return queryset
if not user:
return queryset.none()
kwargs = {}
args = []
if query_group:
groups = user.groups.all()
args.append(Q(users=user) | Q(user_groups__in=groups))
else:
kwargs = {}
args = []
if query_group:
groups = user.groups.all()
args.append(Q(users=user) | Q(user_groups__in=groups))
else:
kwargs["users"] = user
return queryset.filter(*args, **kwargs).distinct()
kwargs["users"] = user
return queryset.filter(*args, **kwargs).distinct()
def filter_user_group(self, queryset):
user_group_id = self.request.query_params.get('user_group_id')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment