Changeset - e91fef0e8d79
[Not reviewed]
0 1 0
Lance Edgar - 3 years ago 2022-01-08 19:49:51
lance@edbob.org
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..
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general) First comment
rattail_corepos/corepos/util.py
Show inline comments
 
@@ -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)
 

	
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now