From 4cfd1bc047bab2b6582706580020980eb896cff2 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Fri, 23 Feb 2024 16:45:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=9C=E7=A8=8B=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/api/applet/applet.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/terminal/api/applet/applet.py b/apps/terminal/api/applet/applet.py index de725c332..1a6b31815 100644 --- a/apps/terminal/api/applet/applet.py +++ b/apps/terminal/api/applet/applet.py @@ -120,8 +120,12 @@ class AppletViewSet(DownloadUploadMixin, JMSBulkModelViewSet): @staticmethod def read_manifest_with_i18n(obj, lang='zh'): - with open(os.path.join(obj.path, 'manifest.yml'), encoding='utf8') as f: - manifest = yaml_load_with_i18n(f, lang) + path = os.path.join(obj.path, 'manifest.yml') + if os.path.exists(path): + with open(path, encoding='utf8') as f: + manifest = yaml_load_with_i18n(f, lang) + else: + manifest = {} return manifest def trans_queryset(self, queryset):