From b96a4bc7b91b96eae66453b9082255730a746ae6 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 20 Aug 2020 20:18:52 -0500 Subject: [PATCH] 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 --- rattail_corepos/corepos/importing/rattail.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rattail_corepos/corepos/importing/rattail.py b/rattail_corepos/corepos/importing/rattail.py index a2dba7f..895a973 100644 --- a/rattail_corepos/corepos/importing/rattail.py +++ b/rattail_corepos/corepos/importing/rattail.py @@ -317,8 +317,9 @@ class ProductImporter(FromRattail, corepos_importing.model.ProductImporter): if corepos_product: # update our Rattail Product with the CORE ID - product.corepos_id = int(corepos_product['id']) - return corepos_product + if not self.dry_run: + product.corepos_id = int(corepos_product['id']) + return corepos_product def update_object(self, corepos_product, data, local_data=None):