forked from rDrama/rDrama
small modification
parent
90507fc8e5
commit
3f54b065fa
|
@ -316,14 +316,12 @@ def purge_bad_games():
|
||||||
g.db.add(game)
|
g.db.add(game)
|
||||||
|
|
||||||
# Victims of this status should have their currency refunded.
|
# Victims of this status should have their currency refunded.
|
||||||
user = g.db.query(User).filter(User.id == game.user_id)
|
user = g.db.query(User).filter(User.id == game.user_id).one()
|
||||||
|
|
||||||
if user:
|
|
||||||
user.winnings += game.wager
|
user.winnings += game.wager
|
||||||
currencyBeforeFix = getattr(user, game.currency, 0)
|
currencyBeforeFix = getattr(user, game.currency, 0)
|
||||||
setattr(user, game.currency, currencyBeforeFix + game.wager)
|
setattr(user, game.currency, currencyBeforeFix + game.wager)
|
||||||
g.db.add(user)
|
g.db.add(user)
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
g.db.flush()
|
# endregion
|
||||||
# endregion
|
|
||||||
|
|
Loading…
Reference in New Issue