Browse Source

Handle None when all stripe plans are empty

master
PCoder 3 years ago
parent
commit
9b8a9c563a
  1. 9
      stripe_utils.py

9
stripe_utils.py

@ -267,10 +267,11 @@ class StripeUtils(object):
def _get_all_stripe_plans(self):
all_stripe_plans = client.get("/v1/stripe_plans")
all_stripe_plans_set = set()
all_stripe_plans_obj = json.loads(all_stripe_plans.value)
if (all_stripe_plans_obj and
len(all_stripe_plans_obj['plans']) > 0):
all_stripe_plans_set = set(all_stripe_plans_obj["plans"])
if all_stripe_plans:
all_stripe_plans_obj = json.loads(all_stripe_plans.value)
if (all_stripe_plans_obj and
len(all_stripe_plans_obj['plans']) > 0):
all_stripe_plans_set = set(all_stripe_plans_obj["plans"])
return all_stripe_plans_set
def _save_all_stripe_plans(self, stripe_plans):

Loading…
Cancel
Save