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