From e91fef0e8d79990f8717b8ff0090e6223b8a10c2 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 8 Jan 2022 19:49:51 -0600 Subject: [PATCH] Refactor CORE API hack to use `custdata` instead of `Customers` table the older table seems more reliable? at least i just ran across an example where it was, albeit a demo.. --- rattail_corepos/corepos/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rattail_corepos/corepos/util.py b/rattail_corepos/corepos/util.py index fd25030..a1e9e89 100644 --- a/rattail_corepos/corepos/util.py +++ b/rattail_corepos/corepos/util.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2022 Lance Edgar # # This file is part of Rattail. # @@ -46,7 +46,7 @@ def get_core_members(api, progress=None): # first we fetch all customer records from CORE DB with short_session(Session=CoreSession) as s: - db_customers = s.query(corepos.Customer).all() + db_customers = s.query(corepos.CustData).all() s.expunge_all() # now we must fetch each customer account individually from API @@ -59,7 +59,7 @@ def get_core_members(api, progress=None): if member: members[dbcust.card_number] = member else: - logger = log.warning if dbcust.account_holder else log.debug + logger = log.warning if dbcust.person_number == 1 else log.debug logger("could not fetch member from CORE API: %s", dbcust.card_number)