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:
parent
4f322456e9
commit
65812190a2
1 changed files with 1 additions and 1 deletions
|
|
@ -510,7 +510,7 @@ class Order(NiceModel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_business(self) -> bool:
|
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
|
@property
|
||||||
def total_price(self) -> float:
|
def total_price(self) -> float:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue