From 255485296cf11ccef72300eb4002a7b1d8d4396e Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 21 Sep 2018 19:58:08 -0500 Subject: [PATCH] Leverage alternate code also, for mobile product quick lookup --- tailbone/views/products.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tailbone/views/products.py b/tailbone/views/products.py index 684c49fc..ff816be4 100644 --- a/tailbone/views/products.py +++ b/tailbone/views/products.py @@ -776,12 +776,14 @@ class ProductsView(MasterView): return self.render_to_response('index', context, mobile=True) def mobile_quick_lookup(self): - entry = self.request.POST['quick_entry'] + entry = self.request.POST['quick_entry'].strip() provided = GPC(entry, calc_check_digit=False) product = api.get_product_by_upc(self.Session(), provided) if not product: checked = GPC(entry, calc_check_digit='upc') product = api.get_product_by_upc(self.Session(), checked) + if not product: + product = api.get_product_by_code(self.Session(), entry) if not product: raise self.notfound() return self.redirect(self.get_action_url('view', product, mobile=True))