Files
modoboa/modoboa/core/context_processors.py
T
2016-10-28 15:48:08 +02:00

17 lines
491 B
Python

"""Custom context processors."""
from modoboa.lib import events
def top_notifications(request):
"""A context processor to include top notifications."""
if request.user.is_anonymous():
return {}
interval = request.localconfig.parameters.get_value(
"top_notifications_check_interval")
return {
"notifications_check_interval": interval * 1000,
"top_notifications": events.raiseQueryEvent(
"TopNotifications", request, False)
}