This commit is contained in:
root 2013-11-11 16:57:41 +00:00
commit 47a74c0056

View file

@ -1217,6 +1217,8 @@ def subscribe(user, plan, token, accepted_plans):
cus = stripe.Customer.retrieve(user.stripe_id) cus = stripe.Customer.retrieve(user.stripe_id)
if plan_found['price'] == 0: if plan_found['price'] == 0:
if cus.subscription is not None:
# We only have to cancel the subscription if they actually have one
cus.cancel_subscription() cus.cancel_subscription()
cus.save() cus.save()