aboutsummaryrefslogtreecommitdiffstats
path: root/src/laas_dashboard
diff options
context:
space:
mode:
authorBrandon Lo <lobrandon1217@gmail.com>2019-11-26 16:39:26 -0500
committerBrandon Lo <lobrandon1217@gmail.com>2019-12-03 15:16:16 -0500
commit6be40a5f2d75b157cf2a2374f2f866f6fdc92b18 (patch)
treebdfa3b9ed77ebfef33f58262950ad551d579e3bb /src/laas_dashboard
parentf1d7b9300fbb06495c6087f975cdbb68a894da37 (diff)
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 <lobrandon1217@gmail.com>
Diffstat (limited to 'src/laas_dashboard')
-rw-r--r--src/laas_dashboard/settings.py6
1 files changed, 6 insertions, 0 deletions
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