diff --git a/code/backend/nest_backend/routes/users/user_delete.py b/code/backend/nest_backend/routes/users/user_delete.py index b3fe041..892e3fb 100644 --- a/code/backend/nest_backend/routes/users/user_delete.py +++ b/code/backend/nest_backend/routes/users/user_delete.py @@ -17,11 +17,12 @@ def page_user_delete(): user = find_user(get_jwt_identity()) if not user.isAdmin: return json_error("User is not admin."), 403 - target = find_user(request.json.get('email')) + deluser=request.json.get('email') + target = find_user(deluser) if not target: return json_error("User not found."), 404 if user == target: return json_error("The user cant delete himself. Its a sin."), 406 - Base.session.remove(target) + Base.session.delete(target) Base.session.commit() return json_success("The user has been deleted.")