Browse Source

fix delete user

testing
Burathar 4 years ago
parent
commit
a8f50d9e13
  1. 2
      app/main/routes.py

2
app/main/routes.py

@ -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()

Loading…
Cancel
Save