forked from rDrama/rDrama
make inifnite currency work again
parent
e5604b7ad5
commit
9d93f521a3
|
@ -224,6 +224,7 @@ class User(Base):
|
|||
if SITE == 'rdrama.net' and self.id == 5237:
|
||||
return
|
||||
|
||||
if self.admin_level < PERMS['INFINITE_CURRENCY']:
|
||||
user_query = g.db.query(User).options(load_only(User.id)).filter_by(id=self.id)
|
||||
|
||||
if currency == 'coins':
|
||||
|
@ -254,6 +255,7 @@ class User(Base):
|
|||
|
||||
should_check_balance = kwargs.get('should_check_balance', True)
|
||||
|
||||
if self.admin_level < PERMS['INFINITE_CURRENCY']:
|
||||
user_query = g.db.query(User).options(load_only(User.id)).filter_by(id=self.id)
|
||||
|
||||
logs = []
|
||||
|
@ -261,6 +263,7 @@ class User(Base):
|
|||
account_balance = self.coins
|
||||
|
||||
if not should_check_balance or account_balance >= amount:
|
||||
if self.admin_level < PERMS['INFINITE_CURRENCY']:
|
||||
user_query.update({ User.coins: User.coins - amount })
|
||||
succeeded = True
|
||||
logs = [['coins', amount]]
|
||||
|
@ -268,6 +271,7 @@ class User(Base):
|
|||
account_balance = self.marseybux
|
||||
|
||||
if not should_check_balance or account_balance >= amount:
|
||||
if self.admin_level < PERMS['INFINITE_CURRENCY']:
|
||||
user_query.update({ User.marseybux: User.marseybux - amount })
|
||||
succeeded = True
|
||||
logs = [['marseybux', amount]]
|
||||
|
@ -281,6 +285,7 @@ class User(Base):
|
|||
if subtracted_coins > self.coins:
|
||||
return False
|
||||
|
||||
if self.admin_level < PERMS['INFINITE_CURRENCY']:
|
||||
user_query.update({
|
||||
User.marseybux: User.marseybux - subtracted_mbux,
|
||||
User.coins: User.coins - subtracted_coins,
|
||||
|
|
Loading…
Reference in New Issue