tab vs. spaces unification (python:(

This commit is contained in:
niekt0 2015-01-31 03:45:50 +01:00
parent 0d2bb2eed7
commit f922edf042
2 changed files with 2 additions and 2 deletions

View file

@ -66,7 +66,7 @@ class Account:
""" Common part of credit() and debit(). """
self.db.execute("INSERT INTO transaction_splits (transaction, side, account, amount, memo) VALUES (%s, %s, %s, %s, %s)", [transaction, side, self.id, amount, memo])
self.db.execute("UPDATE accounts set crbalance = crbalance - (CASE WHEN %s = 'credit' THEN -amount ELSE amount END)", [side])
self.db.execute("UPDATE accounts set crbalance = crbalance - (CASE WHEN %s = 'credit' THEN -amount ELSE amount END)", [side])
def add_barcode(self, barcode):
self.db.execute("INSERT INTO barcodes (account, barcode) VALUES (%s, %s)", [self.id, barcode])

View file

@ -135,7 +135,7 @@ class Shop:
"""list all accounts (people or items, as per acctype)"""
accts = []
cur = self.db.execute_and_fetchall("SELECT id FROM accounts WHERE acctype = %s AND name ILIKE %s ORDER BY name ASC", [acctype, like_str])
#FIXME: sanitize input like_str ^
#FIXME: sanitize input like_str ^
for inventory in cur:
accts += [ Account.load(self.db, id = inventory[0]) ]
return accts