diff --git a/rattail_corepos/datasync/rattail.py b/rattail_corepos/datasync/rattail.py index 5b6e925..18ff5dd 100644 --- a/rattail_corepos/datasync/rattail.py +++ b/rattail_corepos/datasync/rattail.py @@ -24,11 +24,16 @@ DataSync for Rattail DB """ +import logging + from sqlalchemy import orm from rattail.datasync import DataSyncImportConsumer +log = logging.getLogger(__name__) + + class FromCOREAPIToRattail(DataSyncImportConsumer): """ Consumer for CORE POS (API) -> Rattail datasync @@ -69,6 +74,11 @@ class FromCOREAPIToRattail(DataSyncImportConsumer): else: # import member data from API, into various Rattail tables member = self.get_host_object(session, change) + if not member: + # TODO: should log.warning() instead but for now i + # need to see this in action and further troubleshoot + log.error("CORE member not found for change: %s", change) + continue self.process_change(session, self.importers['Customer'], host_object=member) shoppers = self.importers['CustomerShopper'].get_shoppers_for_member(member)