diff options
author | Teddy Wing | 2014-04-20 13:36:40 -0400 |
---|---|---|
committer | Teddy Wing | 2014-04-20 13:36:40 -0400 |
commit | 32a18afffae76053da47350a3ee671ca947860d1 (patch) | |
tree | 8dd75e70166536f6c2af1ff3edfbb9b9fc01a848 | |
parent | ba8146d30296d32b9720b274e75d0724c3559909 (diff) | |
download | django-sneak-peek-32a18afffae76053da47350a3ee671ca947860d1.tar.bz2 |
sneak_peek.py: fix bug getting user
* Don't try to get 'request' from context since it isn't available
unless 'django.core.context_processors.request' is in the
TEMPLATE_CONTEXT_PROCESSORS
* Turns out that 'user' is already in context, so get it directly
instead of having to go through request
-rw-r--r-- | sneak_peek_tag/templatetags/sneak_peek.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sneak_peek_tag/templatetags/sneak_peek.py b/sneak_peek_tag/templatetags/sneak_peek.py index 9a0faa4..977f90a 100644 --- a/sneak_peek_tag/templatetags/sneak_peek.py +++ b/sneak_peek_tag/templatetags/sneak_peek.py @@ -21,7 +21,7 @@ class SneakPeekWrapper(Node): self.style = style def render(self, context): - user = context['request'].user + user = context['user'] # TODO: update with permission check on user user_is_blessed = True |