From d4fec48d9c4eee331b874896c814c276b638bda6 Mon Sep 17 00:00:00 2001 From: Kyle McLaren Date: Tue, 6 Feb 2024 20:58:07 +0200 Subject: [PATCH] get `ENABLE_SIGNUP` from env --- backend/apps/web/main.py | 4 ++-- backend/config.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/apps/web/main.py b/backend/apps/web/main.py index dafb29a5..8877df46 100644 --- a/backend/apps/web/main.py +++ b/backend/apps/web/main.py @@ -11,13 +11,13 @@ from apps.web.routers import ( configs, utils, ) -from config import WEBUI_VERSION, WEBUI_AUTH, DEFAULT_MODELS, DEFAULT_PROMPT_SUGGESTIONS +from config import WEBUI_VERSION, WEBUI_AUTH, DEFAULT_MODELS, DEFAULT_PROMPT_SUGGESTIONS, ENABLE_SIGNUP app = FastAPI() origins = ["*"] -app.state.ENABLE_SIGNUP = True +app.state.ENABLE_SIGNUP = ENABLE_SIGNUP app.state.DEFAULT_MODELS = DEFAULT_MODELS app.state.DEFAULT_PROMPT_SUGGESTIONS = DEFAULT_PROMPT_SUGGESTIONS diff --git a/backend/config.py b/backend/config.py index cb501988..65ee2298 100644 --- a/backend/config.py +++ b/backend/config.py @@ -70,6 +70,7 @@ if OPENAI_API_BASE_URL == "": # WEBUI #################################### +ENABLE_SIGNUP = os.environ.get("ENABLE_SIGNUP", True) DEFAULT_MODELS = os.environ.get("DEFAULT_MODELS", None) DEFAULT_PROMPT_SUGGESTIONS = os.environ.get( "DEFAULT_PROMPT_SUGGESTIONS",