Ejemplo n.º 1
0
 def post(self):
     """
         Create new user
     """
     data = request.json
     # user: User = flask_login.current_user
     return User.create(data)
Ejemplo n.º 2
0
 def post(self):
     """
         Create a new user
     """
     data = request.json
     user = User.query.filter(User.username == data['username']).first()
     if user:
         raise Conflict('Username %s is existed' % data['username'])
     user = User.create(data)
     return user