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..
This commit is contained in:
parent
802ffddc6d
commit
e91fef0e8d
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue