get_special_discount_amount null
This commit is contained in:
@@ -83,8 +83,8 @@ class OrderItemSerailzier(serializers.ModelSerializer):
|
|||||||
if amount is None:
|
if amount is None:
|
||||||
# If it's an order item, check item_special_discount_amount property
|
# If it's an order item, check item_special_discount_amount property
|
||||||
amount = getattr(obj, 'item_special_discount_amount', 0)
|
amount = getattr(obj, 'item_special_discount_amount', 0)
|
||||||
if amount is None:
|
if amount is None or amount == 0:
|
||||||
amount = 0
|
return None
|
||||||
return f'{int(amount):,.0f} تومان'
|
return f'{int(amount):,.0f} تومان'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user