diff --git a/apps/tickets/handler/apply_application.py b/apps/tickets/handler/apply_application.py index 4bdd58984..aa298efa9 100644 --- a/apps/tickets/handler/apply_application.py +++ b/apps/tickets/handler/apply_application.py @@ -26,10 +26,11 @@ class Handler(BaseHandler): meta_display = dict(zip(meta_display_fields, meta_display_values)) apply_system_users = self.ticket.meta.get('apply_system_users') apply_applications = self.ticket.meta.get('apply_applications') - meta_display.update({ - 'apply_system_users_display': [str(i) for i in SystemUser.objects.filter(id__in=apply_system_users)], - 'apply_applications_display': [str(i) for i in Application.objects.filter(id__in=apply_applications)] - }) + with tmp_to_org(self.ticket.org_id): + meta_display.update({ + 'apply_system_users_display': [str(i) for i in SystemUser.objects.filter(id__in=apply_system_users)], + 'apply_applications_display': [str(i) for i in Application.objects.filter(id__in=apply_applications)] + }) return meta_display diff --git a/apps/tickets/handler/apply_asset.py b/apps/tickets/handler/apply_asset.py index 42daf6742..fdc7f2103 100644 --- a/apps/tickets/handler/apply_asset.py +++ b/apps/tickets/handler/apply_asset.py @@ -24,10 +24,11 @@ class Handler(BaseHandler): meta_display = dict(zip(meta_display_fields, meta_display_values)) apply_assets = self.ticket.meta.get('apply_assets') apply_system_users = self.ticket.meta.get('apply_system_users') - meta_display.update({ - 'apply_assets_display': [str(i) for i in Asset.objects.filter(id__in=apply_assets)], - 'apply_system_users_display': [str(i)for i in SystemUser.objects.filter(id__in=apply_system_users)] - }) + with tmp_to_org(self.ticket.org_id): + meta_display.update({ + 'apply_assets_display': [str(i) for i in Asset.objects.filter(id__in=apply_assets)], + 'apply_system_users_display': [str(i)for i in SystemUser.objects.filter(id__in=apply_system_users)] + }) return meta_display # body