From ce1bb66f236915cc3c0bf84efd1175df7bc13435 Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Thu, 18 Jul 2019 13:56:08 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E8=A7=A3=E5=86=B3=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E9=A1=B5=E9=9D=A2=E8=B5=84=E4=BA=A7=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/perms/models/asset_permission.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/perms/models/asset_permission.py b/apps/perms/models/asset_permission.py index b10d33d6b..e76086d71 100644 --- a/apps/perms/models/asset_permission.py +++ b/apps/perms/models/asset_permission.py @@ -103,7 +103,7 @@ class AssetPermission(BasePermission): if pattern: args.append(Q(nodes__key__regex=pattern)) args = reduce(lambda x, y: x | y, args) - assets = Asset.objects.filter(args) + assets = Asset.objects.filter(args).distinct() return assets