mirror of https://github.com/jumpserver/jumpserver
perf: modify only_myself to only_mine
parent
f55869a449
commit
2dd0154967
|
@ -30,7 +30,7 @@ class AdHocViewSet(JMSBulkModelViewSet):
|
|||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
user = self.request.user
|
||||
if is_true(self.request.query_params.get('only_myself')):
|
||||
if is_true(self.request.query_params.get('only_mine')):
|
||||
queryset = queryset.filter(creator=user)
|
||||
else:
|
||||
queryset = queryset.filter(Q(creator=user) | Q(scope=Scope.public))
|
||||
|
|
|
@ -57,7 +57,7 @@ class PlaybookViewSet(JMSBulkModelViewSet):
|
|||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
user = self.request.user
|
||||
if is_true(self.request.query_params.get('only_myself')):
|
||||
if is_true(self.request.query_params.get('only_mine')):
|
||||
queryset = queryset.filter(creator=user)
|
||||
else:
|
||||
queryset = queryset.filter(Q(creator=user) | Q(scope=Scope.public))
|
||||
|
|
Loading…
Reference in New Issue