From 658944e75671c140492fdebb9296a0ce94a493ea Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 17 Feb 2025 19:29:28 -0800 Subject: [PATCH] refac --- backend/open_webui/routers/auths.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/routers/auths.py b/backend/open_webui/routers/auths.py index 16db98ff5..a3f2e8b32 100644 --- a/backend/open_webui/routers/auths.py +++ b/backend/open_webui/routers/auths.py @@ -423,7 +423,6 @@ async def signin(request: Request, response: Response, form_data: SigninForm): @router.post("/signup", response_model=SessionUserResponse) async def signup(request: Request, response: Response, form_data: SignupForm): - user_count = Users.get_num_users() if WEBUI_AUTH: if ( @@ -434,11 +433,12 @@ async def signup(request: Request, response: Response, form_data: SignupForm): status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED ) else: - if user_count != 0: + if Users.get_num_users() != 0: raise HTTPException( status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED ) + user_count = Users.get_num_users() if request.app.state.USER_COUNT and user_count >= request.app.state.USER_COUNT: raise HTTPException( status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED