corporate: Fix 'renewal_amount' always a truthy value on billing page.

Earlier, the 'renewal_amount' context variable passed to the billing
template was always a non-empty string which is a truthy value.

The expected behavior is that 'renewal_amount' should be falsy value
if the renewal_cents is 0. This commit fixes the incorrect behavior
and returns None in this case.
This commit is contained in:
Prakhar Pratyush
2024-02-28 13:56:25 +05:30
committed by Tim Abbott
parent 55326f7000
commit 18d1924823

View File

@@ -2275,7 +2275,7 @@ class BillingSession(ABC):
"licenses_at_next_renewal": licenses_at_next_renewal, "licenses_at_next_renewal": licenses_at_next_renewal,
"seat_count": seat_count, "seat_count": seat_count,
"renewal_date": renewal_date, "renewal_date": renewal_date,
"renewal_amount": cents_to_dollar_string(renewal_cents), "renewal_amount": cents_to_dollar_string(renewal_cents) if renewal_cents != 0 else None,
"payment_method": payment_method, "payment_method": payment_method,
"charge_automatically": charge_automatically, "charge_automatically": charge_automatically,
"stripe_email": stripe_email, "stripe_email": stripe_email,