1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 04:54:18 +00:00

modificato il ritorno per tornare i dati del nuovo utente, perchè tornava i dati di admin

This commit is contained in:
stefanogoldoni 2021-04-28 00:51:31 +02:00
parent 6963e86ee4
commit 9ea852b50b

View file

@ -19,8 +19,8 @@ def page_user_create():
user = find_user(get_jwt_identity())
if not user.isAdmin:
abort(403)
nUser = User(email=request.json.get("email"), password=gen_password(request.json.get("password")),
new_user = User(email=request.json.get("email"), password=gen_password(request.json.get("password")),
username=request.json.get("username"))
Base.session.add(nUser)
Base.session.add(new_user)
Base.session.commit()
return json_success(user.to_json())
return json_success(new_user.to_json())