from django.template import Library, Node

register = Library()

@register.tag(name="sneak_peek")
def sneak_peek(parser, token):
    tag = None
    style = 'default'
    try:
        tag, style = token.split_contents()
    except ValueError:
        pass
    nodelist = parser.parse(('endsneak_peek',))
    parser.delete_first_token()
    return SneakPeekWrapper(nodelist, style)


class SneakPeekWrapper(Node):
    def __init__(self, nodelist, style):
        self.nodelist = nodelist
        self.style = style

    def render(self, context):
        user = context['request'].user
        
        # TODO: update with permission check on user
        user_is_blessed = True

        if user_is_blessed:
            content = self.nodelist.render(context)
            wrapped_hidden_feature = """<div class="sneak-peek %s">
                	%s
                </div>""" % (self.style, content)
            return wrapped_hidden_feature
        else:
            return ''

from django.template import Library, Node

register = Library()

@register.tag(name="sneak_peek")
def sneak_peek(parser, token):
    tag = None
    style = 'default'
    try:
        tag, style = token.split_contents()
    except ValueError:
        pass
    nodelist = parser.parse(('endsneak_peek',))
    parser.delete_first_token()
    return SneakPeekWrapper(nodelist, style)


class SneakPeekWrapper(Node):
    def __init__(self, nodelist, style):
        self.nodelist = nodelist
        self.style = style

    def render(self, context):
        user = context['user']
        
        # TODO: update with permission check on user
        user_is_blessed = True

        if user_is_blessed:
            content = self.nodelist.render(context)
            wrapped_hidden_feature = """<div class="sneak-peek %s">
                	%s
                </div>""" % (self.style, content)
            return wrapped_hidden_feature
        else:
            return ''

fix bug getting user