Import Member.person_uuid from CORE

This commit is contained in:
Lance Edgar 2020-03-18 13:15:37 -05:00
parent 154722b78d
commit 1fea95be97

View file

@ -485,6 +485,7 @@ class MemberImporter(FromCOREPOSAPI, importing.model.MemberImporter):
'number', 'number',
'id', 'id',
'customer_uuid', 'customer_uuid',
'person_uuid',
'joined', 'joined',
'withdrew', 'withdrew',
] ]
@ -526,6 +527,12 @@ class MemberImporter(FromCOREPOSAPI, importing.model.MemberImporter):
member['cardNo'], member) member['cardNo'], member)
return 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: if member['memberStatus'] in self.non_member_status_codes:
log.debug("skipping non-member %s with status '%s': %s", log.debug("skipping non-member %s with status '%s': %s",
member['memberStatus'], member['cardNo'], member) member['memberStatus'], member['cardNo'], member)
@ -551,6 +558,7 @@ class MemberImporter(FromCOREPOSAPI, importing.model.MemberImporter):
'number': int(member['cardNo']), 'number': int(member['cardNo']),
'id': str(member['customerAccountID']), 'id': str(member['customerAccountID']),
'customer_uuid': customer.uuid, 'customer_uuid': customer.uuid,
'person_uuid': person.uuid,
'joined': joined, 'joined': joined,
'withdrew': withdrew, 'withdrew': withdrew,
} }