Skip to content

Fixed updating of stripe donations #2087

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

Conversation

bmispelon
Copy link
Member

@bmispelon bmispelon commented May 30, 2025

This error came on Sentry:

KeyError: 'subscriptions'
  File "stripe/_stripe_object.py", line 170, in __getattr__
    return self[k]
  File "stripe/_stripe_object.py", line 212, in __getitem__
    raise err
  File "stripe/_stripe_object.py", line 200, in __getitem__
    return super(StripeObject, self).__getitem__(k)

AttributeError: subscriptions
  File "django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/views/decorators/cache.py", line 80, in _view_wrapper
    response = view_func(request, *args, **kwargs)
  File "fundraising/views.py", line 135, in manage_donations
    modify_donations_formset.save()
  File "django/forms/models.py", line 796, in save
    return self.save_existing_objects(commit) + self.save_new_objects(commit)
  File "django/forms/models.py", line 945, in save_existing_objects
    saved_instances.append(self.save_existing(form, obj, commit=commit))
  File "django/forms/models.py", line 773, in save_existing
    return form.save(commit=commit)
  File "fundraising/forms.py", line 164, in save
    subscription = customer.subscriptions.retrieve(donation.stripe_subscription_id)
  File "stripe/_stripe_object.py", line 172, in __getattr__
    raise AttributeError(*err.args) from err

@bmispelon bmispelon requested a review from alexgmin May 30, 2025 19:38
@alexgmin
Copy link
Contributor

LGTM

@bmispelon bmispelon merged commit 152809a into django:main May 30, 2025
4 checks passed
@bmispelon bmispelon deleted the fundraising-donation-update-stripe-error branch May 30, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants