mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-22 04:54:18 +00:00
mancava un return
This commit is contained in:
parent
766a16b686
commit
5b28931e9d
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue