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.
This commit is contained in:
saani 2025-11-28 12:50:33 +00:00
parent 027d216fcb
commit 23c185c93d
3 changed files with 19 additions and 5 deletions

View File

@ -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()

View File

@ -269,7 +269,6 @@
Submit a new request with different preferred dates or times
</li>
<li>Consider our group therapy sessions with more availability</li>
<li>Explore our self-guided resources and workshops</li>
<li>Join our waitlist for last-minute availability</li>
</ul>
</div>

View File

@ -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 @@
</head>
<body>
<div class="email-container">
<!-- Header -->
<div class="email-header">
<h1>Appointment Confirmed!</h1>
<p>Your therapy session has been scheduled</p>
@ -264,6 +269,9 @@
<div class="confirmation-title">Your Appointment Details</div>
<div class="appointment-time">{{ scheduled_datetime }}</div>
<div class="therapist-info">With: Nathalie (Therapist)</div>
<div class="login-info">
On the day of your appointment, please login to your account at www.AttuneHeartTherapy.com 15 minutes early to join your Therapy Session.
</div>
</div>
</div>