From 7b15aed77c6675286fd75b8832af58c992717ef9 Mon Sep 17 00:00:00 2001 From: Parker Berberian Date: Wed, 24 Oct 2018 15:12:32 -0400 Subject: Rewrite Notification subsystem In this commit: - delete a lot of really bad and / or unused code - redesign a much simpler Notification model - create and send notifications to the user's inbox on booking start & end - migrations - emails user when booking is ready and when it ends Not in this commit: - Creating notifications from lab messages - warning messages when a booking is about to end - creating "summary" notifications when e.g. a booking has been fulfilled by a lab Change-Id: I69b4dc36c3f2bce76d810106baadeef5a562cc7d Signed-off-by: Parker Berberian --- src/dashboard/tasks.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/dashboard') diff --git a/src/dashboard/tasks.py b/src/dashboard/tasks.py index 48008b6..c619642 100644 --- a/src/dashboard/tasks.py +++ b/src/dashboard/tasks.py @@ -13,17 +13,11 @@ from celery import shared_task from django.utils import timezone from django.db.models import Q from booking.models import Booking -from notifier.manager import * -from notifier.models import * +from notifier.manager import NotificationHandler from api.models import * from resource_inventory.resource_manager import ResourceManager -@shared_task -def conjure_aggregate_notifiers(): - NotifyPeriodic.task() - - @shared_task def booking_poll(): def cleanup_hardware(qs): @@ -86,6 +80,7 @@ def booking_poll(): cleanup_access(AccessRelation.objects.filter(job=job)) job.complete = True job.save() + NotificationHandler.notify_booking_end(booking) @shared_task -- cgit 1.2.3-korg