New feature: check for new versions.

fix #551
This commit is contained in:
Antoine Nguyen
2014-07-26 15:09:02 +02:00
parent 39f2386414
commit cf84644fab
18 changed files with 293 additions and 83 deletions
+18
View File
@@ -0,0 +1,18 @@
"""
Custom context processors.
"""
from modoboa.lib import events, parameters
def top_notifications(request):
"""
A context processor to include top notifications.
"""
if request.user.is_anonymous():
return {}
return {
"notifications_check_interval":
int(parameters.get_admin("TOP_NOTIFICATIONS_CHECK_INTERVAL")) * 1000,
"top_notifications": events.raiseQueryEvent(
"TopNotifications", request.user, False)
}