Only assign new CORE ID if not in dry run mode

b/c if dry run, we didn't really make the API call so there is no ID
This commit is contained in:
Lance Edgar 2020-08-20 20:18:52 -05:00
parent d3e2619944
commit b96a4bc7b9

View file

@ -317,8 +317,9 @@ class ProductImporter(FromRattail, corepos_importing.model.ProductImporter):
if corepos_product: if corepos_product:
# update our Rattail Product with the CORE ID # update our Rattail Product with the CORE ID
product.corepos_id = int(corepos_product['id']) if not self.dry_run:
return corepos_product product.corepos_id = int(corepos_product['id'])
return corepos_product
def update_object(self, corepos_product, data, local_data=None): def update_object(self, corepos_product, data, local_data=None):