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 07a8f05ed7 - Show all commits

View File

@ -80,7 +80,7 @@ def _on_subscription_created_needs_payment(sender: looper.models.Subscription, *
tasks.send_mail_bank_transfer_required(subscription_id=sender.pk) tasks.send_mail_bank_transfer_required(subscription_id=sender.pk)
user = sender.customer.user user = sender.customer.user
if not user: if not user:
logger.error('Cannot grand role to an account-less customer pk=%s', sender.customer_id) logger.error('Cannot grant role to an account-less customer pk=%s', sender.customer_id)
return return
users.tasks.grant_blender_id_role(pk=user.pk, role='cloud_has_subscription') users.tasks.grant_blender_id_role(pk=user.pk, role='cloud_has_subscription')
@ -95,7 +95,7 @@ def _on_subscription_status_changed(sender: looper.models.Subscription, **kwargs
def _on_subscription_status_activated(sender: looper.models.Subscription, **kwargs): def _on_subscription_status_activated(sender: looper.models.Subscription, **kwargs):
user = sender.customer.user user = sender.customer.user
if not user: if not user:
logger.error('Cannot grand role to an account-less customer pk=%s', sender.customer_id) logger.error('Cannot grant role to an account-less customer pk=%s', sender.customer_id)
return return
users.tasks.grant_blender_id_role(pk=user.pk, role='cloud_has_subscription') users.tasks.grant_blender_id_role(pk=user.pk, role='cloud_has_subscription')
users.tasks.grant_blender_id_role(pk=user.pk, role='cloud_subscriber') users.tasks.grant_blender_id_role(pk=user.pk, role='cloud_subscriber')