Skip to content

Commit

Permalink
fix: preserve web behaviour for mailbox verify code override (#2240)
Browse files Browse the repository at this point in the history
  • Loading branch information
cquintana92 authored Sep 30, 2024
1 parent 6d17eaa commit 8cbd8eb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/mailbox_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,11 @@ def generate_activation_code(
mailbox: Mailbox, use_digit_code: bool = False
) -> MailboxActivation:
clear_activation_codes_for_mailbox(mailbox)
if config.MAILBOX_VERIFICATION_OVERRIDE_CODE:
code = config.MAILBOX_VERIFICATION_OVERRIDE_CODE
elif use_digit_code:
code = "{:06d}".format(random.randint(1, 999999))
if use_digit_code:
if config.MAILBOX_VERIFICATION_OVERRIDE_CODE:
code = config.MAILBOX_VERIFICATION_OVERRIDE_CODE
else:
code = "{:06d}".format(random.randint(1, 999999))
else:
code = secrets.token_urlsafe(16)
return MailboxActivation.create(
Expand Down

0 comments on commit 8cbd8eb

Please sign in to comment.