Fixed race condition when transacting to own user
This commit is contained in:
parent
16cfd63e4a
commit
f432ffc70b
|
@ -59,6 +59,7 @@ class VirtualTransaction(models.Model):
|
|||
|
||||
@staticmethod
|
||||
def moveMoney(fromUser, toUser, amount, commit=True):
|
||||
if fromUser != toUser:
|
||||
fromProfile = fromUser.get_profile()
|
||||
toProfile = toUser.get_profile()
|
||||
fromProfile.balance -= amount
|
||||
|
|
Loading…
Reference in New Issue