mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-31 15:11:27 +00:00
[Update] 修改缩进
This commit is contained in:
@@ -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')
|
||||
|
Reference in New Issue
Block a user