From d2a15ee7029ac5bc704eb250ba9ecee7e5c7d745 Mon Sep 17 00:00:00 2001 From: xinwen Date: Thu, 17 Dec 2020 12:28:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=B3=E8=AF=B7=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E5=A6=82=E6=9E=9C=E7=B3=BB=E7=BB=9F=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=B2=A1=E5=A1=AB=E5=86=85=E5=AE=B9=E4=B8=8D=E6=8E=A8?= =?UTF-8?q?=E8=8D=90=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tickets/serializers/request_asset_perm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/tickets/serializers/request_asset_perm.py b/apps/tickets/serializers/request_asset_perm.py index 83c480e61..9bc70b79a 100644 --- a/apps/tickets/serializers/request_asset_perm.py +++ b/apps/tickets/serializers/request_asset_perm.py @@ -133,9 +133,9 @@ class RequestAssetPermTicketSerializer(serializers.ModelSerializer): def _recommend_system_users(self, data, instance): confirmed_system_users = data.get('confirmed_system_users') - if not confirmed_system_users and self._is_assignee(instance): - system_user = data.get('system_user') + system_user = data.get('system_user') + if all((not confirmed_system_users, self._is_assignee(instance), system_user)): recomand_system_users_id = SystemUser.objects.filter( name__icontains=system_user )[:3].values_list('id', flat=True)