projects
/
matthijs
/
projects
/
xerxes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d34130e
)
Show only public comments to non-staff.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 31 Jul 2008 22:36:37 +0000
(
00:36
+0200)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 31 Jul 2008 22:36:37 +0000
(
00:36
+0200)
influences/views.py
patch
|
blob
|
history
diff --git
a/influences/views.py
b/influences/views.py
index ea07c70c03f86c668562ced31549d3673d8bd72c..2dbd5c990ec692fa3ccf99b454f74fbab3d32492 100644
(file)
--- 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")
# 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,
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))
'comment_form' : ThreadedCommentForm(),
}
return render_to_response('influences/influence_detail.html', context, RequestContext(request))