From 22a876d3ceba0e7a90a3fa44f99eaa2cf68f68b0 Mon Sep 17 00:00:00 2001 From: pi3c Date: Mon, 12 Feb 2024 23:03:28 +0300 Subject: [PATCH] =?UTF-8?q?google=20sheets=20docker=20=D0=BE=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastfood/service/summary.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fastfood/service/summary.py b/fastfood/service/summary.py index 735c53f..b5cddef 100644 --- a/fastfood/service/summary.py +++ b/fastfood/service/summary.py @@ -42,7 +42,10 @@ class SummaryService: discont = await self.cache.get(f"DISCONT:{str(obj.get('id'))}") if discont is not None: - discont = float(discont) + try: + discont = float(discont) + except Exception: + discont = 0.0 obj['price'] = round( obj['price'] - (obj['price'] * discont / 100), 2 )