From ca14884c460e7fe7c0d0c902a8251ed938ca81de Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 21 Jan 2021 17:58:11 -0600 Subject: [PATCH] Don't choke when unit size is not decimal-compatible --- rattail_corepos/importing/model.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rattail_corepos/importing/model.py b/rattail_corepos/importing/model.py index 2f31ba0..a2a1f0a 100644 --- a/rattail_corepos/importing/model.py +++ b/rattail_corepos/importing/model.py @@ -140,7 +140,10 @@ class ProductImporter(importing.model.ProductImporter): unit_size = None if 'size' in core_data and core_data['size'] is not None: - unit_size = decimal.Decimal(core_data['size']) + try: + unit_size = decimal.Decimal(core_data['size']) + except decimal.InvalidOperation: + pass uom_abbrev = core_data.get('unitofmeasure')