From 2fc68ca6f1595ac9b0a9c440272a1a4cb16e541c Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 13 Jan 2020 18:56:58 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E6=8E=88=E6=9D=83=E7=9A=84=20Remote?= =?UTF-8?q?App/DatabaseApp=20=E8=BF=9B=E8=A1=8C=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/perms/utils/database_app_permission.py | 2 +- apps/perms/utils/remote_app_permission.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/perms/utils/database_app_permission.py b/apps/perms/utils/database_app_permission.py index 526b0fc59..88a96c4c9 100644 --- a/apps/perms/utils/database_app_permission.py +++ b/apps/perms/utils/database_app_permission.py @@ -56,7 +56,7 @@ class DatabaseAppPermissionUtil: def get_database_apps(self): database_apps = DatabaseApp.objects.filter( granted_by_permissions__in=self.permissions - ) + ).distinct() return database_apps def get_database_app_system_users(self, database_app): diff --git a/apps/perms/utils/remote_app_permission.py b/apps/perms/utils/remote_app_permission.py index bb86f2c80..d9d4a6e23 100644 --- a/apps/perms/utils/remote_app_permission.py +++ b/apps/perms/utils/remote_app_permission.py @@ -9,7 +9,6 @@ from orgs.utils import set_to_root_org from ..models import RemoteAppPermission from ..hands import RemoteApp, SystemUser - __all__ = [ 'RemoteAppPermissionUtil', 'construct_remote_apps_tree_root', @@ -56,7 +55,7 @@ class RemoteAppPermissionUtil: def get_remote_apps(self): remote_apps = RemoteApp.objects.filter( granted_by_permissions__in=self.permissions - ) + ).distinct() return remote_apps def get_remote_app_system_users(self, remote_app):