From 93537c07a1a3ef3a00c68154114287b08b14c365 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Fri, 15 Jul 2022 11:38:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E7=BB=84=E7=BB=87=E9=97=AE=E9=A2=98=20(#8599?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng626 <1304903146@qq.com> --- apps/tickets/handlers/apply_application.py | 8 +++++--- apps/tickets/handlers/apply_asset.py | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/tickets/handlers/apply_application.py b/apps/tickets/handlers/apply_application.py index 15c76c7e5..5b7712553 100644 --- a/apps/tickets/handlers/apply_application.py +++ b/apps/tickets/handlers/apply_application.py @@ -16,16 +16,18 @@ class Handler(BaseHandler): # permission def _create_application_permission(self): - with tmp_to_root_org(): + org_id = self.ticket.org_id + with tmp_to_org(org_id): application_permission = ApplicationPermission.objects.filter(id=self.ticket.id).first() if application_permission: return application_permission + apply_applications = self.ticket.apply_applications.all() + apply_system_users = self.ticket.apply_system_users.all() + apply_permission_name = self.ticket.apply_permission_name apply_category = self.ticket.apply_category apply_type = self.ticket.apply_type - apply_applications = self.ticket.apply_applications.all() - apply_system_users = self.ticket.apply_system_users.all() apply_date_start = self.ticket.apply_date_start apply_date_expired = self.ticket.apply_date_expired permission_created_by = '{}:{}'.format( diff --git a/apps/tickets/handlers/apply_asset.py b/apps/tickets/handlers/apply_asset.py index 136347782..e9d29697d 100644 --- a/apps/tickets/handlers/apply_asset.py +++ b/apps/tickets/handlers/apply_asset.py @@ -16,15 +16,17 @@ class Handler(BaseHandler): # permission def _create_asset_permission(self): - with tmp_to_root_org(): + org_id = self.ticket.org_id + with tmp_to_org(org_id): asset_permission = AssetPermission.objects.filter(id=self.ticket.id).first() if asset_permission: return asset_permission + apply_nodes = self.ticket.apply_nodes.all() + apply_assets = self.ticket.apply_assets.all() + apply_system_users = self.ticket.apply_system_users.all() + apply_permission_name = self.ticket.apply_permission_name - apply_nodes = self.ticket.apply_nodes.all() - apply_assets = self.ticket.apply_assets.all() - apply_system_users = self.ticket.apply_system_users.all() apply_actions = self.ticket.apply_actions apply_date_start = self.ticket.apply_date_start apply_date_expired = self.ticket.apply_date_expired