From 5b28931e9de1a9548623a826d1b54c4d904fd509 Mon Sep 17 00:00:00 2001 From: stefanogoldoni Date: Thu, 29 Apr 2021 00:29:12 +0200 Subject: [PATCH] mancava un return --- code/backend/nest_backend/routes/users/user_create.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/backend/nest_backend/routes/users/user_create.py b/code/backend/nest_backend/routes/users/user_create.py index 1f36faf..799583b 100644 --- a/code/backend/nest_backend/routes/users/user_create.py +++ b/code/backend/nest_backend/routes/users/user_create.py @@ -17,8 +17,10 @@ def page_user_create(): {'result':'failure', 'content':'something blew up'}, else it returns {'result':'success', 'content':newUser.to_json(). """ user = find_user(get_jwt_identity()) + print(user) + print(user.isAdmin) if not user.isAdmin: - json_error("User is not admin. Thou art not authorized."), 403 + return json_error("User is not admin. Thou are not authorized."), 403 new_user = User(email=request.json.get("email"), password=gen_password(request.json.get("password")), username=request.json.get("username")) Base.session.add(new_user)