Skip to content

Commit 658944e

Browse files
committed
refac
1 parent ba6cde8 commit 658944e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/open_webui/routers/auths.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ async def signin(request: Request, response: Response, form_data: SigninForm):
423423

424424
@router.post("/signup", response_model=SessionUserResponse)
425425
async def signup(request: Request, response: Response, form_data: SignupForm):
426-
user_count = Users.get_num_users()
427426

428427
if WEBUI_AUTH:
429428
if (
@@ -434,11 +433,12 @@ async def signup(request: Request, response: Response, form_data: SignupForm):
434433
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED
435434
)
436435
else:
437-
if user_count != 0:
436+
if Users.get_num_users() != 0:
438437
raise HTTPException(
439438
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED
440439
)
441440

441+
user_count = Users.get_num_users()
442442
if request.app.state.USER_COUNT and user_count >= request.app.state.USER_COUNT:
443443
raise HTTPException(
444444
status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.ACCESS_PROHIBITED

0 commit comments

Comments
 (0)