From 29166f4b1e377834d18e1156d561df873d362448 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 16 Mar 2020 16:08:14 -0500 Subject: [PATCH] Rename the old CORE Customer model, to CustData it now has a new Customer model, so we use that where we can --- rattail_corepos/corepos/importing/db/corepos.py | 4 ++-- rattail_corepos/corepos/importing/db/model.py | 4 ++-- rattail_corepos/importing/corepos/api.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rattail_corepos/corepos/importing/db/corepos.py b/rattail_corepos/corepos/importing/db/corepos.py index e1904f5..774781f 100644 --- a/rattail_corepos/corepos/importing/db/corepos.py +++ b/rattail_corepos/corepos/importing/db/corepos.py @@ -66,7 +66,7 @@ class FromCoreToCoreBase(object): importers['Product'] = ProductImporter importers['ProductFlag'] = ProductFlagImporter importers['Employee'] = EmployeeImporter - importers['Customer'] = CustomerImporter + importers['CustData'] = CustDataImporter importers['MemberType'] = MemberTypeImporter importers['MemberInfo'] = MemberInfoImporter importers['HouseCoupon'] = HouseCouponImporter @@ -140,7 +140,7 @@ class ProductFlagImporter(FromCore, corepos_importing.model.ProductFlagImporter) class EmployeeImporter(FromCore, corepos_importing.model.EmployeeImporter): pass -class CustomerImporter(FromCore, corepos_importing.model.CustomerImporter): +class CustDataImporter(FromCore, corepos_importing.model.CustDataImporter): pass class MemberTypeImporter(FromCore, corepos_importing.model.MemberTypeImporter): diff --git a/rattail_corepos/corepos/importing/db/model.py b/rattail_corepos/corepos/importing/db/model.py index b347ec0..54d0354 100644 --- a/rattail_corepos/corepos/importing/db/model.py +++ b/rattail_corepos/corepos/importing/db/model.py @@ -92,8 +92,8 @@ class EmployeeImporter(ToCore): key = 'number' -class CustomerImporter(ToCore): - model_class = corepos.Customer +class CustDataImporter(ToCore): + model_class = corepos.CustData key = 'id' diff --git a/rattail_corepos/importing/corepos/api.py b/rattail_corepos/importing/corepos/api.py index ea54eab..29f12ff 100644 --- a/rattail_corepos/importing/corepos/api.py +++ b/rattail_corepos/importing/corepos/api.py @@ -102,7 +102,7 @@ class CustomerImporter(FromCOREPOSAPI, importing.model.CustomerImporter): if customer: customers[dbcust.card_number] = customer else: - logger = log.warning if dbcust.person_number == 1 else log.debug + logger = log.warning if dbcust.account_holder else log.debug logger("could not fetch customer from CORE API: %s", dbcust.card_number)