generated from bisco/codex-bootstrap
fix: show local confirmation links before email send
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user