diff --git a/lab/experiments/management/commands/send_reminders.py b/lab/experiments/management/commands/send_reminders.py index 57707f38..2a1cb433 100644 --- a/lab/experiments/management/commands/send_reminders.py +++ b/lab/experiments/management/commands/send_reminders.py @@ -14,11 +14,12 @@ class Command(BaseCommand): def handle(self, *args, **options): # fetch appoinments 24 hours from now now = datetime.now() - threshold = now + timedelta(days=1) + threshold_from = now + timedelta(days=1) + threshold_to = now + timedelta(days=2) appointments = Appointment.objects.filter( - timeslot__start__gt=now, timeslot__start__lte=threshold, reminder_sent=None - ) + timeslot__start__gt=threshold_from, timeslot__start__lte=threshold_to, reminder_sent=None + ).exclude(outcome=Appointment.Outcome.CANCELED) for appointment in appointments: mail = TemplateEmail(