1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00
Files
seahub/notifications/utils.py

12 lines
378 B
Python
Raw Normal View History

from django.core.cache import cache
from seahub.notifications.models import Notification
2012-06-06 13:55:55 +08:00
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),
2012-06-06 13:55:55 +08:00
NOTIFICATION_CACHE_TIMEOUT)