Move a block of code

somehow it was stuck right in the middle of some other contiguous blocks, and
the sequence just seemed wrong
This commit is contained in:
Lance Edgar 2020-04-01 17:21:25 -05:00
parent 16c80082ad
commit 28f17ca31a

View file

@ -329,15 +329,6 @@ class InventoryItemImporter(FromCore, catapult_importing.model.InventoryItemImpo
logger("product %s has %s vendorItems but each is missing (valid) vendor: %s",
product.upc, len(product.vendor_items), product)
scale_item = product.scale_item
scale_ingredient_text = None
if scale_item:
scale_ingredient_text = scale_item.text
if "\n" in scale_ingredient_text:
log.warning("must remove carriage returns for scale ingredients: %s",
scale_ingredient_text)
scale_ingredient_text = scale_ingredient_text.replace("\n", " ")
if vendor_items:
if len(vendor_items) > 1:
@ -376,6 +367,15 @@ class InventoryItemImporter(FromCore, catapult_importing.model.InventoryItemImpo
product.upc, len(memo), memo)
memo = memo[:254]
scale_item = product.scale_item
scale_ingredient_text = None
if scale_item:
scale_ingredient_text = scale_item.text
if "\n" in scale_ingredient_text:
log.warning("must remove carriage returns for scale ingredients: %s",
scale_ingredient_text)
scale_ingredient_text = scale_ingredient_text.replace("\n", " ")
return {
'item_id': item_id,
'dept_id': department.number,