1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-05-02 21:18:44 +00:00
seahub/notifications/utils.py
2012-06-06 13:55:55 +08:00

12 lines
378 B
Python

from django.core.cache import cache
from seahub.notifications.models import Notification
from seahub.notifications.settings import NOTIFICATION_CACHE_TIMEOUT
def refresh_cache():
"""
Function to be called when change primary notification.
"""
cache.set('CUR_TOPINFO', Notification.objects.all().filter(primary=1),
NOTIFICATION_CACHE_TIMEOUT)