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.
This commit is contained in:
Egor Pavlovich Gorbunov 2025-05-06 17:22:48 +03:00
parent 4f322456e9
commit 65812190a2

View file

@ -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: