From 22788ff2da141cc8af6c20157ef663f19ca5905e Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 2 Jul 2024 13:55:46 +0800 Subject: [PATCH] perf: remove org api scope --- apps/common/serializers/fields.py | 2 +- apps/rbac/api/role.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/common/serializers/fields.py b/apps/common/serializers/fields.py index 71a4672e2..b3b4cd925 100644 --- a/apps/common/serializers/fields.py +++ b/apps/common/serializers/fields.py @@ -122,7 +122,7 @@ class LabelRelatedField(serializers.RelatedField): from labels.models import LabeledResource, Label if data is None: return data - if isinstance(data, dict) and data.get("id") or data.get("pk"): + if isinstance(data, dict) and (data.get("id") or data.get("pk")): pk = data.get("id") or data.get("pk") label = Label.objects.get(pk=pk) else: diff --git a/apps/rbac/api/role.py b/apps/rbac/api/role.py index 2b61b59ec..1580578b1 100644 --- a/apps/rbac/api/role.py +++ b/apps/rbac/api/role.py @@ -24,7 +24,7 @@ class RoleViewSet(JMSModelViewSet): } ordering = ('-builtin', 'name') filterset_class = RoleFilter - search_fields = ('name', 'scope', 'builtin') + search_fields = ('name', 'builtin') rbac_perms = { 'users': 'rbac.view_rolebinding' }