From f758414844654c39368e40f5cb817bb94d64e025 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Wed, 13 Jul 2022 16:54:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=A1=E6=89=B9=E6=97=B6=20=E6=9D=A5?= =?UTF-8?q?=E7=9D=80=E4=B8=8D=E5=90=8C=E7=BB=84=E7=BB=87=E7=9A=84=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E6=A0=A1=E9=AA=8C=20(#8586)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng626 <1304903146@qq.com> --- apps/tickets/api/ticket.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/tickets/api/ticket.py b/apps/tickets/api/ticket.py index 1df3506c1..d6e623892 100644 --- a/apps/tickets/api/ticket.py +++ b/apps/tickets/api/ticket.py @@ -77,7 +77,8 @@ class TicketViewSet(CommonApiMixin, viewsets.ModelViewSet): partial = kwargs.pop('partial', False) instance = self.get_object() serializer = self.get_serializer(instance, data=request.data, partial=partial) - serializer.is_valid(raise_exception=True) + with tmp_to_root_org(): + serializer.is_valid(raise_exception=True) instance = serializer.save() instance.approve(processor=request.user) return Response('ok')