Ejemplo n.º 1
0
def register():
    flask.request.json["date"] = datetime.datetime.now()
    print(flask.request.json)
    user_controller = UserController()
    if user_controller.get_user(flask.request.json['username']) is None:
        user_controller.insert_user(flask.request.json)
        return "OK"
    else:
        return json.dumps({"msg": "User is already registered"}), 401
Ejemplo n.º 2
0
def post_user():
    user_controller = UserController()
    user_controller.insert_user(flask.request.json)
    return "OK"