This commit is contained in:
Joseph Schorr 2013-11-11 17:53:29 -05:00
commit 743e95c50e
4 changed files with 34 additions and 14 deletions

View file

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