Stripe checkout #104411
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user