users: use with_for_update() in charge_account

master
justcool393 2022-11-01 01:14:18 -05:00
parent 6d636e4e42
commit d53c714bb7
1 changed files with 1 additions and 1 deletions

View File

@ -173,7 +173,7 @@ class User(Base):
def charge_account(self, currency, amount):
in_db = g.db.query(User).filter(User.id == self.id).one()
in_db = g.db.query(User).filter(User.id == self.id).with_for_update().one()
succeeded = False
if currency == 'coins':