diff --git a/src/thunderbird_accounts/mail/utils.py b/src/thunderbird_accounts/mail/utils.py index 407f6b80..68e6b2fd 100644 --- a/src/thunderbird_accounts/mail/utils.py +++ b/src/thunderbird_accounts/mail/utils.py @@ -48,7 +48,6 @@ def decode_app_password(secret): def create_stalwart_account(user, app_password: Optional[str] = None) -> bool: - # Run this immediately for now, in the future we'll ship these to celery if user.account_set.count() > 0 and user.account_set.first().stalwart_id: return False diff --git a/src/thunderbird_accounts/subscription/views.py b/src/thunderbird_accounts/subscription/views.py index 5a926a3c..2390924c 100644 --- a/src/thunderbird_accounts/subscription/views.py +++ b/src/thunderbird_accounts/subscription/views.py @@ -124,8 +124,11 @@ def paddle_transaction_complete(request: HttpRequest, paddle: Client): status = transaction.status.value if transaction and status in [Transaction.StatusValues.COMPLETED.value, Transaction.StatusValues.PAID.value]: - user.is_awaiting_payment_verification = True - user.save() + # Only set enable payment verification mode if they don't have an active subscription + # As the webhook could technically come in before or during this successUrl redirect... + if not user.has_active_subscription: + user.is_awaiting_payment_verification = True + user.save() if settings.IS_DEV: tasks.dev_only_paddle_fake_webhook.delay(transaction_id=transaction_id, user_uuid=user.uuid.hex)