From d1d69e94885531f7fd8413c000b477d68f141cb3 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 18 Sep 2023 18:28:11 -0500 Subject: [PATCH] Show user warning if receive quick lookup fails just b/c a UPC doesn't exist yet doesn't prevent the batch from (in some cases) adding a row for "unknown product" - but if the UPC is sufficiently invalid, that can't happen --- tailbone/api/batch/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tailbone/api/batch/core.py b/tailbone/api/batch/core.py index f239aaaf..c98e01f1 100644 --- a/tailbone/api/batch/core.py +++ b/tailbone/api/batch/core.py @@ -333,6 +333,9 @@ class APIBatchRowView(APIBatchMixin, APIMasterView): msg = "Feature is not implemented" return {'error': msg} + if not row: + return {'error': "Could not identify product"} + self.Session.flush() result = self._get(obj=row) result['ok'] = True