From b7179e7cfc4cc73e8527187f824b77e5791adaed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Mon, 28 Mar 2022 02:03:31 +0000 Subject: [PATCH] limit query --- api/kiwi_vpn_api/routers/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/kiwi_vpn_api/routers/admin.py b/api/kiwi_vpn_api/routers/admin.py index ce03583..99dfdeb 100644 --- a/api/kiwi_vpn_api/routers/admin.py +++ b/api/kiwi_vpn_api/routers/admin.py @@ -58,7 +58,7 @@ async def create_initial_admin( raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST) with Connection.session as db: - if db.exec(select(User)).first() is not None: + if db.exec(select(User).limit(1)).first() is not None: raise HTTPException(status_code=status.HTTP_409_CONFLICT) # create an administrative user