aboutsummaryrefslogtreecommitdiffstats
path: root/src/notifier/tasks.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2020-02-06 18:34:17 +0000
committerGerrit Code Review <gerrit@opnfv.org>2020-02-06 18:34:17 +0000
commit868dc419abbec2988dfe48cbd9d6f7cf56a48079 (patch)
tree7ce55022654d3fee68ed4833888a4f15590e61ae /src/notifier/tasks.py
parent078273eb7db5a481a4131d44a943f3c9e34b6b88 (diff)
parent77377d5e9362bd35a3b300df231e82ee974675e1 (diff)
Merge "Comments and Documentation"
Diffstat (limited to 'src/notifier/tasks.py')
-rw-r--r--src/notifier/tasks.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/notifier/tasks.py b/src/notifier/tasks.py
index b45ab8e..474d64d 100644
--- a/src/notifier/tasks.py
+++ b/src/notifier/tasks.py
@@ -19,15 +19,15 @@ from notifier.manager import NotificationHandler
@shared_task
def notify_expiring():
- """
- Notify users if their booking is within 48 hours of expiring.
- """
+ """Notify users if their booking is within 48 hours of expiring."""
expire_time = timezone.now() + timezone.timedelta(hours=settings.EXPIRE_HOURS)
# Don't email people about bookings that have started recently
start_time = timezone.now() - timezone.timedelta(hours=settings.EXPIRE_LIFETIME)
- bookings = Booking.objects.filter(end__lte=expire_time,
+ bookings = Booking.objects.filter(
+ end__lte=expire_time,
end__gte=timezone.now(),
- start__lte=start_time)
+ start__lte=start_time
+ )
for booking in bookings:
if Emailed.objects.filter(almost_end_booking=booking).exists():
continue