def put(self): claims = get_jwt_claims() if claims["admin"]: data = game_parser.parse_args() newgame = GameModel(title=data["title"], description=data["description"], riddles=int(data["riddles"])) newgame.save_to_db() return GameModel.serialize([newgame]) else: return { "message": "Admin privileges are required to perform this action" }
def get(self, game_id): return GameModel.serialize([GameModel.find_by_id(game_id)])