fix: show local confirmation links before email send

This commit is contained in:
bisco
2026-04-30 01:29:10 +02:00
parent 240ea3aba3
commit 833d4e629c
2 changed files with 13 additions and 21 deletions

View File

@@ -13,14 +13,12 @@ def build_confirmation_link(raw_confirmation_token):
return f"{settings.SITE_BASE_URL}{CONFIRMATION_PATH}?token={raw_confirmation_token}"
def _log_confirmation_link_for_local_debug(*, reservation, confirmation_link, reason):
def _log_confirmation_link_for_local_debug(*, confirmation_link):
if not settings.LOG_RESERVATION_CONFIRMATION_URLS:
return
logger.info(
"Local reservation confirmation link for manual testing (%s) for reservation %s: %s",
reason,
reservation.id,
logger.warning(
"LOCAL DEV confirmation URL: %s",
confirmation_link,
)
@@ -36,9 +34,7 @@ def send_confirmation_email(*, reservation, raw_confirmation_token):
)
_log_confirmation_link_for_local_debug(
reservation=reservation,
confirmation_link=confirmation_link,
reason="email send attempt",
)
try:
@@ -52,9 +48,8 @@ def send_confirmation_email(*, reservation, raw_confirmation_token):
except Exception:
if settings.LOG_RESERVATION_CONFIRMATION_URLS:
logger.warning(
"Failed to send confirmation email for reservation %s in local/debug mode.",
"Local/debug email delivery failed for reservation %s.",
reservation.id,
exc_info=True,
)
return