forked from brmlab/brmbar-github
Shop.py: python <3.6 compatibility
This commit is contained in:
parent
597bca87b5
commit
cd9b4484c8
1 changed files with 5 additions and 3 deletions
|
@ -28,7 +28,8 @@ class Shop:
|
|||
# Call the stored procedure for the sale
|
||||
cost = self.db.execute_and_fetch(
|
||||
"SELECT public.sell_item(%s, %s, %s, %s, %s)",
|
||||
[item.id, amount, user.id, self.currency.id, f"BrmBar sale of {amount}x {item.name} to {user.name}"]
|
||||
[item.id, amount, user.id, self.currency.id,
|
||||
"BrmBar sale of {0}x {1} to {2}".format(amount, item.name, user.name)]
|
||||
)[0]#[0]
|
||||
|
||||
self.db.commit()
|
||||
|
@ -48,7 +49,8 @@ class Shop:
|
|||
def sell_for_cash(self, item, amount = 1):
|
||||
cost = self.db.execute_and_fetch(
|
||||
"SELECT public.sell_item_for_cash(%s, %s, %s, %s, %s)",
|
||||
[item.id, amount, user.id, self.currency.id, f"BrmBar sale of {amount}x {item.name} for cash"]
|
||||
[item.id, amount, user.id, self.currency.id,
|
||||
"BrmBar sale of {0}x {1} for cash".format(amount, item.name)]
|
||||
)[0]#[0]
|
||||
|
||||
self.db.commit()
|
||||
|
@ -79,7 +81,7 @@ class Shop:
|
|||
# Call the stored procedure for undoing a sale
|
||||
cost = self.db.execute_and_fetch(
|
||||
"SELECT public.undo_sale_of_item(%s, %s, %s, %s)",
|
||||
[item.id, amount, user.id, user.currency.id, f"BrmBar sale UNDO of {amount}x {item.name} to {user.name}"]
|
||||
[item.id, amount, user.id, user.currency.id, "BrmBar sale UNDO of {0}x {1} to {2}".format(amount, item.name, user.name)]
|
||||
)[0]#[0]
|
||||
|
||||
self.db.commit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue