From a775c24cbc98806e6eb402616df4c399181f171d Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 28 Sep 2012 23:20:00 +0200 Subject: [PATCH] brmbar.Account.create(): Fix SQL usage --- brmbar3/brmbar/Account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brmbar3/brmbar/Account.py b/brmbar3/brmbar/Account.py index 9c9b8f5..f398c58 100644 --- a/brmbar3/brmbar/Account.py +++ b/brmbar3/brmbar/Account.py @@ -50,7 +50,7 @@ class Account: def create(cls, db, name, currency, acctype): """ Constructor for new account """ with closing(db.cursor()) as cur: - cur.execute("INSERT INTO accounts (name, currency, acctype) VALUES (%s, %s, %s) RETURNING id", [name, currency, acctype]) + cur.execute("INSERT INTO accounts (name, currency, acctype) VALUES (%s, %s, %s) RETURNING id", [name, currency.id, acctype]) id = cur.fetchone()[0] return cls(db, name = name, id = id, currency = currency, acctype = acctype)