Esempio n. 1
0
def update_game(game):
    auth_user = request.headers['auth_user']
    game = DAO.find(Game, id=game.id)
    if (game.is_same_user(auth_user)):
        DAO.update(game)
        return "Ok"
    else:
        return abort(401)
Esempio n. 2
0
def update_character(character):
    auth_user = request.headers['auth_user']
    game = DAO.find(Game, id=character.game)
    if (game.is_same_user(auth_user)):
        character.game = game
        DAO.update(character)
        return "Ok"
    else:
        return abort(401)