Advertisement
Anophoo

json

Feb 23rd, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. @account.route("/signup", methods=["POST"])
  2. @produces_json
  3. def signup():
  4. js = request.json
  5. user_name = get_or_error(js, "user_name")
  6. first_name = js.get("first_name")
  7. last_name = js.get("last_name")
  8. password = get_or_error(js, "password")
  9. verification_identity = uuid.uuid4().hex
  10. user = User.get(user_name)
  11. if user is not None and user.verified:
  12. return "Invalid verification", 400
  13. user = User.signup(user_name, password, first_name, last_name, verification_identity)
  14. return user.to_json()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement