Skip to content
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

Fixes an issue with duplicate gold subscriptions #4597

Merged
merged 1 commit into from Sep 5, 2018

Conversation

@davidfischer
Copy link
Contributor

@davidfischer davidfischer commented Aug 31, 2018

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 requested review from agjohnson and Aug 31, 2018
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

@davidfischer davidfischer Aug 31, 2018

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.

humitos
humitos approved these changes Sep 4, 2018
Copy link
Member

@humitos humitos left a comment

Changes look good to me.

@davidfischer
Copy link
Contributor Author

@davidfischer davidfischer commented Sep 5, 2018

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

Looks great!

@agjohnson agjohnson merged commit 181a964 into master Sep 5, 2018
1 check passed
@agjohnson agjohnson deleted the davidfischer/fix-subscriptions-doubling branch Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants