1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-22 03:47:09 +00:00

update set_notice_seen_by_id

This commit is contained in:
lian
2016-08-19 15:17:46 +08:00
committed by lian
parent 5a700d5f00
commit 86f948aaa8
6 changed files with 53 additions and 32 deletions

View File

@@ -1255,32 +1255,6 @@ def get_popup_notices(request):
"notice_html": notice_html,
}), content_type=content_type)
@login_required_ajax
@require_POST
def set_notice_seen_by_id(request):
"""
Arguments:
- `request`:
"""
content_type = 'application/json; charset=utf-8'
notice_id = request.GET.get('notice_id')
try:
notice = UserNotification.objects.get(id=notice_id)
except UserNotification.DoesNotExist as e:
logger.error(e)
return HttpResponse(json.dumps({
'error': _(u'Failed')
}), status=400, content_type=content_type)
if not notice.seen:
notice.seen = True
notice.save()
return HttpResponse(json.dumps({'success': True}), content_type=content_type)
@login_required_ajax
def space_and_traffic(request):
content_type = 'application/json; charset=utf-8'