From 206a4877c7a52007e96fb7a0d0ebfdc9db346e2c Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 19 Nov 2024 18:17:38 -0800 Subject: [PATCH] fix: api key creation --- backend/open_webui/apps/webui/routers/auths.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/apps/webui/routers/auths.py b/backend/open_webui/apps/webui/routers/auths.py index 630a8bcbf..262a2bb86 100644 --- a/backend/open_webui/apps/webui/routers/auths.py +++ b/backend/open_webui/apps/webui/routers/auths.py @@ -739,7 +739,7 @@ async def update_ldap_config( # create api key @router.post("/api_key", response_model=ApiKey) async def create_api_key(request: Request, user=Depends(get_current_user)): - if not request.app.config.state.ENABLE_API_KEY: + if not request.app.state.config.ENABLE_API_KEY: raise HTTPException( status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.API_KEY_CREATION_NOT_ALLOWED,