Skip to content

Fixes an issue with duplicate gold subscriptions #4597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2018

Conversation

davidfischer
Copy link
Contributor

This PR fixes a bug that could result in a user having multiple gold subscriptions.

I am also going to go back through our gold subscriptions and find any users that have more than 1 subscription as that is likely an error.

Fixes #4595
Fixes #4503

@davidfischer davidfischer added the Bug A bug label Aug 31, 2018
@davidfischer davidfischer requested review from agjohnson and a team August 31, 2018 19:47
subscription = subscriptions.data[0]
subscription.plan = self.cleaned_data['level']
if 'stripe_token' in self.cleaned_data:
if 'stripe_token' in self.cleaned_data and self.cleaned_data['stripe_token']:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error was on this line specifically. In the case where the user is swapping their credit card, the stripe_token is present and the API call succeeds and everything is good. In the case where the user is just changing plans, stripe_token is None, the API call fails and the except clause is taken which adds a new subscription.

Because of that possibility of just having a failed API call result in more subscriptions, I rewrote that part of this function.

Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me.

@davidfischer
Copy link
Contributor Author

I am also going to go back through our gold subscriptions and find any users that have more than 1 subscription as that is likely an error.

I have cancelled all duplicate subscriptions and refunded Gold Members for the duplicate charges.

Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@agjohnson agjohnson merged commit 181a964 into master Sep 5, 2018
@agjohnson agjohnson deleted the davidfischer/fix-subscriptions-doubling branch September 5, 2018 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Ads Shown For Gold User Logged In with Adblock Upgrading a Gold subscription causes two recurring charges
3 participants