From 65812190a26faf2f9162bd0269175879143c1ab0 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Tue, 6 May 2025 17:22:48 +0300 Subject: [PATCH] Fix `is_business` property to handle missing attributes Previously, the method could raise an error if `attributes` was None. This update ensures the method returns `False` when `attributes` is not defined, preventing potential runtime issues. --- core/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/models.py b/core/models.py index 87abeddf..8dcab745 100644 --- a/core/models.py +++ b/core/models.py @@ -510,7 +510,7 @@ class Order(NiceModel): @property def is_business(self) -> bool: - return self.attributes.get("is_business", False) + return self.attributes.get("is_business", False) if self.attributes else False @property def total_price(self) -> float: