Fix db 3.

This commit is contained in:
Dominik Pantůček 2025-08-21 17:13:30 +02:00
parent aee3a1d24f
commit 92deae6775

View file

@ -20,7 +20,7 @@ class Account:
@classmethod @classmethod
def load_by_barcode(cls, db, barcode): def load_by_barcode(cls, db, barcode):
logger.debug("load_by_barcode: '%s'", barcode) logger.debug("load_by_barcode: '%s'", barcode)
account_id, account_name, account_acctype, currency_id, currency_name = self.db.execute_and_fetch( account_id, account_name, account_acctype, currency_id, currency_name = db.execute_and_fetch(
"SELECT account_id, account_name, account_acctype, currency_id, currency_name FROM public.account_class_initialization_data('by_barcode', NULL, %s)", "SELECT account_id, account_name, account_acctype, currency_id, currency_name FROM public.account_class_initialization_data('by_barcode', NULL, %s)",
[barcode]) [barcode])
currency = Currency(db, currency_id, currency_name) currency = Currency(db, currency_id, currency_name)
@ -29,7 +29,7 @@ class Account:
@classmethod @classmethod
def load(cls, db, id=None): def load(cls, db, id=None):
"""Constructor for existing account""" """Constructor for existing account"""
account_id, account_name, account_acctype, currency_id, currency_name = self.db.execute_and_fetch( account_id, account_name, account_acctype, currency_id, currency_name = db.execute_and_fetch(
"SELECT account_id, account_name, account_acctype, currency_id, currency_name FROM public.account_class_initialization_data('by_id', %s, NULL)", "SELECT account_id, account_name, account_acctype, currency_id, currency_name FROM public.account_class_initialization_data('by_id', %s, NULL)",
[id]) [id])
currency = Currency(db, currency_id, currency_name) currency = Currency(db, currency_id, currency_name)