Fix a bug in billing dealing with former customers.

This commit is contained in:
yackob03 2013-10-02 12:43:25 -04:00
parent 35c1e6e53b
commit f572749ace

View file

@ -401,7 +401,9 @@ def get_subscription():
if user.stripe_id: if user.stripe_id:
private_repos = model.get_private_repo_count(user.username) private_repos = model.get_private_repo_count(user.username)
cus = stripe.Customer.retrieve(user.stripe_id) cus = stripe.Customer.retrieve(user.stripe_id)
return jsonify(subscription_view(cus.subscription, private_repos))
if cus.subscription:
return jsonify(subscription_view(cus.subscription, private_repos))
abort(404) abort(404)