Stripe checkout #104411

Merged
Anna Sirota merged 61 commits from stripe into main 2024-06-17 18:08:41 +02:00
Showing only changes of commit cca91cc7a5 - Show all commits

View File

@ -111,8 +111,10 @@ def _on_subscription_status_activated(sender: looper.models.Subscription, **kwar
@receiver(looper.signals.subscription_expired) @receiver(looper.signals.subscription_expired)
def _on_subscription_status_deactivated(sender: looper.models.Subscription, **kwargs): def _on_subscription_status_deactivated(sender: looper.models.Subscription, **kwargs):
# No other active subscription exists, subscriber badge can be revoked # No other active subscription exists, subscriber badge can be revoked
if not queries.has_active_subscription(sender.user): customer = sender.customer
users.tasks.revoke_blender_id_role(pk=sender.user_id, role='cloud_subscriber') user = customer.user
if user and not queries.has_active_subscription(user):
users.tasks.revoke_blender_id_role(pk=user.pk, role='cloud_subscriber')
if not hasattr(sender, 'team'): if not hasattr(sender, 'team'):
return return