diff --git a/hosting/views.py b/hosting/views.py index 207c95c9..f082ae1b 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -626,6 +626,10 @@ class SettingsView(LoginRequiredMixin, FormView): exp_year=card_details_response['exp_year'], card_id=card_details_response['card_id'] ) + stripe_utils.associate_customer_card( + request.user.stripecustomer.stripe_id, + token + ) msg = _( "Successfully associated the card with your account" ) diff --git a/membership/models.py b/membership/models.py index ca403347..dc76a8dc 100644 --- a/membership/models.py +++ b/membership/models.py @@ -212,8 +212,8 @@ class StripeCustomer(models.Model): stripe_customer.user, token) if "deleted" in customer and customer["deleted"]: raise StripeCustomer.DoesNotExist() - if not customer.sources.data: - stripe_utils.update_customer_token(customer, token) + #if not customer.sources.data: + # stripe_utils.update_customer_token(customer, token) return stripe_customer except StripeCustomer.DoesNotExist: user = CustomUser.objects.get(email=email)