From 876093ec83578ce7b30f6c02416e489bced8efc6 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 1 Aug 2008 00:36:37 +0200 Subject: [PATCH] Show only public comments to non-staff. --- influences/views.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/influences/views.py b/influences/views.py index ea07c70..2dbd5c9 100644 --- a/influences/views.py +++ b/influences/views.py @@ -105,9 +105,17 @@ def influence_detail(request, object_id): # Don't show other player's influences if (o.character.player != request.user): return HttpResponseForbidden("Forbidden -- Trying to view influences of somebody else's character") + + # Show all comments to staff, but only public comments to other + # users + if request.user.is_staff: + comments = ThreadedComment.objects.get_tree(o) + else: + comments = ThreadedComment.public.get_tree(o) + context = { 'object' : o, - 'comments' : ThreadedComment.public.get_tree(o), + 'comments' : comments, 'comment_form' : ThreadedCommentForm(), } return render_to_response('influences/influence_detail.html', context, RequestContext(request)) -- 2.30.2