浏览代码

fix: config json backward compatibility issue

Timothy J. Baek 1 年之前
父节点
当前提交
74638bbd6e
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      backend/main.py

+ 5 - 1
backend/main.py

@@ -168,7 +168,11 @@ async def get_app_config():
         "status": True,
         "name": WEBUI_NAME,
         "version": VERSION,
-        "default_locale": CONFIG_DATA["ui"]["default_locale"],
+        "default_locale": (
+            CONFIG_DATA["ui"]["default_locale"]
+            if "default_locale" in CONFIG_DATA["ui"]
+            else "en-US"
+        ),
         "images": images_app.state.ENABLED,
         "default_models": webui_app.state.DEFAULT_MODELS,
         "default_prompt_suggestions": webui_app.state.DEFAULT_PROMPT_SUGGESTIONS,