def delete(request, notification_id): kind = request.GET.get('kind','') or request.POST.get('kind','') if not kind: raise Http404 notification = utils.get_object_by_id(get_class(kind), notification_id) utils.verify_user(request, notification.receiver) notification.delete() return {}
def detail(request, notification_id): kind = request.GET.get('kind','') or request.POST.get('kind','') if not kind: raise Http404 notification = utils.get_object_by_id(get_class(kind), notification_id, method = request.method) notification.mark_read() utils.verify_user(request, notification.receiver) return {'notification': notification}
def delete(request, pm_id): private_message = utils.get_object_by_id(PrivateMessage, pm_id) utils.verify_user(request, private_message.sender) private_message.delete() return {}
def detail(request, pm_id): private_message = utils.get_object_by_id(PrivateMessage, pm_id, method=request.method) utils.verify_user(request, (private_message.sender, private_message.receiver)) return {"private_message": private_message}
def delete_comment(request, comment_id): comment = utils.get_object_by_id(Comment, comment_id) utils.verify_user(request, comment.author) comment.delete() return {}