mirror of
http://88.130.71.182:3000/BlitTech/badoHair_be.git
synced 2026-06-13 09:00:42 +00:00
Fix booking status update failing when SMTP not configured
This commit is contained in:
@@ -185,11 +185,14 @@ async def admin_update_booking(
|
||||
if email:
|
||||
slot = await db.fetchrow("SELECT date, start_time FROM time_slots WHERE id = $1", str(booking["slot_id"]))
|
||||
if slot:
|
||||
from app.services import email_service
|
||||
if status == "confirmed":
|
||||
await email_service.send_booking_confirmed(email, str(slot["date"]), _fmt_time(slot["start_time"]))
|
||||
elif status == "cancelled":
|
||||
await email_service.send_booking_cancelled(email, str(slot["date"]), _fmt_time(slot["start_time"]))
|
||||
try:
|
||||
from app.services import email_service
|
||||
if status == "confirmed":
|
||||
await email_service.send_booking_confirmed(email, str(slot["date"]), _fmt_time(slot["start_time"]))
|
||||
elif status == "cancelled":
|
||||
await email_service.send_booking_cancelled(email, str(slot["date"]), _fmt_time(slot["start_time"]))
|
||||
except Exception:
|
||||
pass # Email failure must not block the status update
|
||||
|
||||
await _log(db, actor_id, f"booking.{status}", "booking", booking_id)
|
||||
return await get_booking(db, booking_id)
|
||||
|
||||
Reference in New Issue
Block a user