aboutsummaryrefslogtreecommitdiffstats
path: root/sneak_peek_tag
diff options
context:
space:
mode:
authorTeddy Wing2014-04-20 19:19:28 -0400
committerTeddy Wing2014-04-20 19:19:28 -0400
commitd5eca1cfa81f5f839e55e658ff7d5c2d086779dd (patch)
treec095a4b53c907468221a498adcfa3e6ed2262eab /sneak_peek_tag
parent16c4b5259395712e88bda2675da9c355e479e4c1 (diff)
downloaddjango-sneak-peek-d5eca1cfa81f5f839e55e658ff7d5c2d086779dd.tar.bz2
sneak_peek.py: use permission for conditional display
Use the permission we just created with our data migration to conditionally display the sneak_peek-ed markup.
Diffstat (limited to 'sneak_peek_tag')
-rw-r--r--sneak_peek_tag/templatetags/sneak_peek.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/sneak_peek_tag/templatetags/sneak_peek.py b/sneak_peek_tag/templatetags/sneak_peek.py
index 977f90a..1873498 100644
--- a/sneak_peek_tag/templatetags/sneak_peek.py
+++ b/sneak_peek_tag/templatetags/sneak_peek.py
@@ -22,9 +22,7 @@ class SneakPeekWrapper(Node):
def render(self, context):
user = context['user']
-
- # TODO: update with permission check on user
- user_is_blessed = True
+ user_is_blessed = user.has_perm('sneak_peek_tag.can_view_sneak_peek')
if user_is_blessed:
content = self.nodelist.render(context)