Swap the order of your filters:
visits = Visit.objects.filter(
Q(sms_reminder=True) | Q(email_reminder=True),
date__range=(now, delta),
)
From the Q
docs:
However, if a Q object is provided, it must precede the definition of any keyword arguments.
Standard python: args then kwargs. (Caught me out a few times)