billing: Don't use data attribute for iterating through subscriptions.

Iterating through data attribute is same as iterating through
subscriptions.
This commit is contained in:
Vishnu Ks 2018-07-24 18:05:22 +05:30 committed by Rishi Gupta
parent 0bcc0ca0d8
commit 1225bfd6ee
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ def get_upcoming_invoice(stripe_customer_id: str) -> stripe.Invoice:
def extract_current_subscription(stripe_customer: stripe.Customer) -> Any:
if not stripe_customer.subscriptions:
return None
for stripe_subscription in stripe_customer.subscriptions.data:
for stripe_subscription in stripe_customer.subscriptions:
if stripe_subscription.status != "canceled":
return stripe_subscription
return None