Skip to content

Commit 7453606

Browse files
committed
Don't enable payment verification mode if they already have a sub (Fixes #642)
1 parent 7c16ec7 commit 7453606

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/thunderbird_accounts/mail/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def decode_app_password(secret):
4848

4949

5050
def create_stalwart_account(user, app_password: Optional[str] = None) -> bool:
51-
# Run this immediately for now, in the future we'll ship these to celery
5251
if user.account_set.count() > 0 and user.account_set.first().stalwart_id:
5352
return False
5453

src/thunderbird_accounts/subscription/views.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ def paddle_transaction_complete(request: HttpRequest, paddle: Client):
124124
status = transaction.status.value
125125

126126
if transaction and status in [Transaction.StatusValues.COMPLETED.value, Transaction.StatusValues.PAID.value]:
127-
user.is_awaiting_payment_verification = True
128-
user.save()
127+
# Only set enable payment verification mode if they don't have an active subscription
128+
# As the webhook could technically come in before or during this successUrl redirect...
129+
if not user.has_active_subscription:
130+
user.is_awaiting_payment_verification = True
131+
user.save()
129132

130133
if settings.IS_DEV:
131134
tasks.dev_only_paddle_fake_webhook.delay(transaction_id=transaction_id, user_uuid=user.uuid.hex)

0 commit comments

Comments
 (0)