Exemple #1
0
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 {}
Exemple #2
0
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}
Exemple #3
0
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 {}
Exemple #4
0
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}
Exemple #5
0
def delete_comment(request, comment_id):
	comment = utils.get_object_by_id(Comment, comment_id)
	utils.verify_user(request, comment.author)
	comment.delete()
	return {}