From 23c185c93de26383b96df6f0cb304ab7b48d8fff Mon Sep 17 00:00:00 2001 From: saani Date: Fri, 28 Nov 2025 12:50:33 +0000 Subject: [PATCH] refactor(meetings): standardize null handling for Jitsi fields and enhance emails - Set explicit default=None for jitsi_room_id field to ensure consistent null handling - Update rejection logic to use None instead of empty strings for Jitsi fields, maintaining database consistency with nullable field definitions - Add login instructions to appointment confirmation email directing users to join 15 minutes early - Remove outdated "self-guided resources" option from rejection email - Add styling for new login-info section in scheduled appointment template This ensures proper null value handling in the database and improves user communication for appointment workflows. --- meetings/models.py | 13 ++++++++++--- templates/emails/appointment_rejected.html | 1 - templates/emails/appointment_scheduled.html | 10 +++++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/meetings/models.py b/meetings/models.py index e351183..9bd407a 100644 --- a/meetings/models.py +++ b/meetings/models.py @@ -204,7 +204,14 @@ class AppointmentRequest(models.Model): rejection_reason = EncryptedTextField(blank=True) jitsi_meet_url = models.URLField(blank=True, null=True, help_text="Jitsi Meet URL for the video session") - jitsi_room_id = models.CharField(max_length=100, unique=True, null=True, blank=True, help_text="Jitsi room ID") + jitsi_room_id = models.CharField( + max_length=100, + unique=True, + null=True, + blank=True, + default=None, + help_text="Jitsi room ID" + ) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) @@ -306,8 +313,8 @@ class AppointmentRequest(models.Model): self.status = 'rejected' self.rejection_reason = reason self.scheduled_datetime = None - self.jitsi_meet_url = '' - self.jitsi_room_id = '' + self.jitsi_meet_url = None + self.jitsi_room_id = None if commit: self.save() diff --git a/templates/emails/appointment_rejected.html b/templates/emails/appointment_rejected.html index 3e3a561..f534b5a 100644 --- a/templates/emails/appointment_rejected.html +++ b/templates/emails/appointment_rejected.html @@ -269,7 +269,6 @@ Submit a new request with different preferred dates or times
  • Consider our group therapy sessions with more availability
  • -
  • Explore our self-guided resources and workshops
  • Join our waitlist for last-minute availability
  • diff --git a/templates/emails/appointment_scheduled.html b/templates/emails/appointment_scheduled.html index da702f5..5773ccc 100644 --- a/templates/emails/appointment_scheduled.html +++ b/templates/emails/appointment_scheduled.html @@ -193,6 +193,12 @@ transform: translateY(-2px); } + .login-info { + color: #2d3748; + font-size: 16px; + margin-top: 10px; + } + .email-footer { background-image: linear-gradient(to right, #e11d48, #db2777, #f97316); padding: 30px; @@ -245,7 +251,6 @@
    -