Forráskód Böngészése

fix: api key creation

Timothy Jaeryang Baek 5 hónapja
szülő
commit
206a4877c7
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      backend/open_webui/apps/webui/routers/auths.py

+ 1 - 1
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,