From 1fea95be97db99c538e165cc81edc01a0bc3e331 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 18 Mar 2020 13:15:37 -0500 Subject: [PATCH] Import `Member.person_uuid` from CORE --- rattail_corepos/importing/corepos/api.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rattail_corepos/importing/corepos/api.py b/rattail_corepos/importing/corepos/api.py index 241dd5c..80e276c 100644 --- a/rattail_corepos/importing/corepos/api.py +++ b/rattail_corepos/importing/corepos/api.py @@ -485,6 +485,7 @@ class MemberImporter(FromCOREPOSAPI, importing.model.MemberImporter): 'number', 'id', 'customer_uuid', + 'person_uuid', 'joined', 'withdrew', ] @@ -526,6 +527,12 @@ class MemberImporter(FromCOREPOSAPI, importing.model.MemberImporter): member['cardNo'], member) return + person = customer.first_person() + if not person: + log.warning("Rattail person not found for cardNo %s: %s", + member['cardNo'], member) + return + if member['memberStatus'] in self.non_member_status_codes: log.debug("skipping non-member %s with status '%s': %s", member['memberStatus'], member['cardNo'], member) @@ -551,6 +558,7 @@ class MemberImporter(FromCOREPOSAPI, importing.model.MemberImporter): 'number': int(member['cardNo']), 'id': str(member['customerAccountID']), 'customer_uuid': customer.uuid, + 'person_uuid': person.uuid, 'joined': joined, 'withdrew': withdrew, }