mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-11-29 11:44:28 +01:00
@@ -1,18 +1,16 @@
|
||||
"""
|
||||
Custom context processors.
|
||||
"""
|
||||
from modoboa.lib import events, parameters
|
||||
"""Custom context processors."""
|
||||
|
||||
from modoboa.lib import events
|
||||
|
||||
|
||||
def top_notifications(request):
|
||||
"""
|
||||
A context processor to include top notifications.
|
||||
"""
|
||||
"""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":
|
||||
int(parameters.get_admin("TOP_NOTIFICATIONS_CHECK_INTERVAL")) * 1000,
|
||||
"notifications_check_interval": interval * 1000,
|
||||
"top_notifications": events.raiseQueryEvent(
|
||||
"TopNotifications", request, False)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user