From 08cd91c42688fa6b5280eefb1794d1383cffb92d Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 24 Sep 2021 13:57:20 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E6=A0=91=EF=BC=8C=E6=B2=A1=E6=9C=89=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/applications/api/mixin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/applications/api/mixin.py b/apps/applications/api/mixin.py index ff939bf0b..59bc51467 100644 --- a/apps/applications/api/mixin.py +++ b/apps/applications/api/mixin.py @@ -32,6 +32,8 @@ class SerializeApplicationToTreeNodeMixin: return node def serialize_applications_with_org(self, applications): + if not applications: + return [] root_node = self.create_root_node() tree_nodes = [root_node] organizations = self.filter_organizations(applications)