forked from brmlab/brmbar-github
brmbarv3: Add missing db.commit() at two places
This commit is contained in:
parent
b11cd6c338
commit
6a71841112
2 changed files with 3 additions and 0 deletions
|
@ -119,6 +119,8 @@ class ShopAdapter(QtCore.QObject):
|
||||||
cost = ""
|
cost = ""
|
||||||
if (acct.balance() < int(invmap["balance"])):
|
if (acct.balance() < int(invmap["balance"])):
|
||||||
cost = shop.buy_for_cash(acct, invmap["balance"] - acct.balance())
|
cost = shop.buy_for_cash(acct, invmap["balance"] - acct.balance())
|
||||||
|
else:
|
||||||
|
db.commit()
|
||||||
return { "dbid": dbid, "cost": (currency.str(cost) if cost != "" else "") }
|
return { "dbid": dbid, "cost": (currency.str(cost) if cost != "" else "") }
|
||||||
|
|
||||||
@QtCore.Slot('QVariant', result='QVariant')
|
@QtCore.Slot('QVariant', result='QVariant')
|
||||||
|
|
|
@ -82,6 +82,7 @@ class Account:
|
||||||
def add_barcode(self, barcode):
|
def add_barcode(self, barcode):
|
||||||
with closing(self.db.cursor()) as cur:
|
with closing(self.db.cursor()) as cur:
|
||||||
cur.execute("INSERT INTO barcodes (account, barcode) VALUES (%s, %s)", [self.id, barcode])
|
cur.execute("INSERT INTO barcodes (account, barcode) VALUES (%s, %s)", [self.id, barcode])
|
||||||
|
self.db.commit()
|
||||||
|
|
||||||
def rename(self, name):
|
def rename(self, name):
|
||||||
with closing(self.db.cursor()) as cur:
|
with closing(self.db.cursor()) as cur:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue