1234567891011 |
- from djstripe import webhooks
- @webhooks.handler("customer.subscription.updated", "customer.subscription.created")
- def update_subscription(event, **kwargs):
- """When the subscription is updated, immediately check for throttle adjustments"""
- # Avoid importing models during django app startup
- from apps.organizations_ext.tasks import check_organization_throttle
- if event.customer.subscriber_id:
- check_organization_throttle.delay(event.customer.subscriber_id)
|