Skip to content

Plan price returns None object. #45

@arpankotecha

Description

@arpankotecha

Hello,

I'm running python 2.7.6

I'm trying to loop through all apps and get the price for each addon associated with the app to calculate the total cost of the app. I thought the code below should work but plan.price is None:

for app in conn.apps():
        price_breakdown = []

        addon_list = app.addons()
        for addon in addon_list:
              plan = addon.plan
              price_breakdown.append((
                '{}@{}'.format(app.name, plan.name),
                plan.price.cents))

I get the following trace:

  File "/vagrant/tasks.py", line 129, in check_prices
    plan.price.cents))
AttributeError: 'NoneType' object has no attribute 'cents'

Any thoughts on how I can get the pricing info for each app addon?
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions