From fba1bf6514c0cde62827f07ea61ec2cae00fdd34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Wed, 23 Mar 2022 13:42:43 +0000 Subject: [PATCH] nonexistent user deletion --- api/kiwi_vpn_api/routers/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/kiwi_vpn_api/routers/user.py b/api/kiwi_vpn_api/routers/user.py index 66dcd7e..935f066 100644 --- a/api/kiwi_vpn_api/routers/user.py +++ b/api/kiwi_vpn_api/routers/user.py @@ -131,7 +131,7 @@ async def remove_user( ) # fail if deletion was unsuccessful - if not user.delete(db): + if user is None or not user.delete(db): raise HTTPException(status_code=status.HTTP_409_CONFLICT)