|
|
@ -210,7 +210,7 @@ def remove_player(game_name, username): |
|
|
|
if not game.owned_by(current_user): |
|
|
|
if not game.owned_by(current_user): |
|
|
|
abort(403) |
|
|
|
abort(403) |
|
|
|
user = User.query.filter(and_(User.name == username, User.games.contains(game))).first_or_404() |
|
|
|
user = User.query.filter(and_(User.name == username, User.games.contains(game))).first_or_404() |
|
|
|
game.players.remove(user) |
|
|
|
game.users.remove(user) |
|
|
|
if not user.last_login: |
|
|
|
if not user.last_login: |
|
|
|
db.session.delete(user) |
|
|
|
db.session.delete(user) |
|
|
|
db.session.commit() |
|
|
|
db.session.commit() |
|
|
|