コード例 #1
0
ファイル: views.py プロジェクト: zxhx/seahub
def notification_delete(request, nid):
    if not request.user.is_staff:
        raise Http404
    Notification.objects.filter(id=nid).delete()
    refresh_cache()

    return HttpResponseRedirect(reverse('notification_list', args=[]))
コード例 #2
0
ファイル: views.py プロジェクト: TanLian/seahub
def notification_delete(request, nid):
    if not request.user.is_staff:
        raise Http404
    Notification.objects.filter(id=nid).delete()
    refresh_cache()

    return HttpResponseRedirect(reverse('notification_list', args=[]))
コード例 #3
0
ファイル: views.py プロジェクト: zxhx/seahub
def set_primary(request, nid):
    if not request.user.is_staff:
        raise Http404

    # TODO: use transaction?
    Notification.objects.filter(primary=1).update(primary=0)
    Notification.objects.filter(id=nid).update(primary=1)

    refresh_cache()

    return HttpResponseRedirect(reverse('notification_list', args=[]))
コード例 #4
0
ファイル: views.py プロジェクト: TanLian/seahub
def set_primary(request, nid):
    if not request.user.is_staff:
        raise Http404
    
    # TODO: use transaction?
    Notification.objects.filter(primary=1).update(primary=0)
    Notification.objects.filter(id=nid).update(primary=1)

    refresh_cache()
    
    return HttpResponseRedirect(reverse('notification_list', args=[]))
コード例 #5
0
 def get_from_db(self):
     ret = Notification.objects.all().filter(primary=1)
     refresh_cache()
     return ret
コード例 #6
0
ファイル: middleware.py プロジェクト: ERamseth/seahub
 def get_from_db(self):
     ret = Notification.objects.all().filter(primary=1)
     refresh_cache()
     return ret