Shop: sell log res

This commit is contained in:
Dominik Pantůček 2025-07-12 17:40:16 +02:00
parent 0a8e2b727b
commit 343df879fb

View file

@ -30,12 +30,13 @@ class Shop:
# Call the stored procedure for the sale
logger.debug("sell: item.id=%s amount=%s user.id=%s self.currency.id=%s",
item.id, amount, user.id, self.currency.id)
cost = self.db.execute_and_fetch(
res = self.db.execute_and_fetch(
"SELECT public.sell_item(%s, %s, %s, %s, %s)",
[item.id, amount, user.id, self.currency.id,
"BrmBar sale of {0}x {1} to {2}".format(amount, item.name, user.name)]
)[0]#[0]
)#[0]
logger.debug("sell: res=%s", res)
cost = res[0]
self.db.commit()
return cost
# Sale: Currency conversion from item currency to shop currency