From 6be40a5f2d75b157cf2a2374f2f866f6fdc92b18 Mon Sep 17 00:00:00 2001 From: Brandon Lo Date: Tue, 26 Nov 2019 16:39:26 -0500 Subject: Add warning email and notification This adds the abandoned changes made to the notification system and also adds a simple task to check for expiring bookings and sends out emails and notifications. Change-Id: I1530d19f41cf93626bb642e6b269f9ec55860b81 Signed-off-by: Brandon Lo --- src/laas_dashboard/settings.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/laas_dashboard') diff --git a/src/laas_dashboard/settings.py b/src/laas_dashboard/settings.py index b73e2c8..951ce1a 100644 --- a/src/laas_dashboard/settings.py +++ b/src/laas_dashboard/settings.py @@ -192,6 +192,10 @@ CELERYBEAT_SCHEDULE = { 'task': 'dashboard.tasks.free_hosts', 'schedule': timedelta(minutes=1) }, + 'notify_expiring': { + 'task': 'notifier.tasks.notify_expiring', + 'schedule': timedelta(hours=1) + }, } # Notifier Settings @@ -202,3 +206,5 @@ EMAIL_HOST_PASSWORD = os.environ['EMAIL_HOST_PASSWORD'] EMAIL_USE_TLS = True DEFAULT_EMAIL_FROM = os.environ.get('DEFAULT_EMAIL_FROM', 'webmaster@localhost') SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies" +EXPIRE_LIFETIME = 12 # Minimum lifetime of booking to send notification +EXPIRE_HOURS = 48 # Notify when booking is expiring within this many hours -- cgit 1.2.3-korg