1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-05-03 13:37:13 +00:00
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 05:55:55 +00: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 05:55:55 +00:00
NOTIFICATION_CACHE_TIMEOUT)