perf: modify only_myself to only_mine

pull/14083/head
wangruidong 2024-09-11 18:01:01 +08:00 committed by Bryan
parent f55869a449
commit 2dd0154967
2 changed files with 2 additions and 2 deletions

View File

@ -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))

View File

@ -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))