hooks.py 442 B

12345678910
  1. from djstripe import webhooks
  2. @webhooks.handler("customer.subscription.updated", "customer.subscription.created")
  3. def update_subscription(event, **kwargs):
  4. """When the subscription is updated, immediately check for throttle adjustments"""
  5. # Avoid importing models during django app startup
  6. from apps.organizations_ext.tasks import check_organization_throttle
  7. check_organization_throttle.delay(event.customer.subscriber_id)