Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions feature_flipper/templatetags/feature_flipper.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ def render(self, context):
"""
user = self._get_value(self.user_key, context)
feature = self._get_value(self.feature, context)
allowed = show_feature(user, feature)

if feature is None:
return ''

allowed = show_feature(user, feature)
return self.nodelist.render(context) if allowed else ''

def _get_value(self, key, context):
Expand All @@ -57,4 +60,4 @@ def _get_value(self, key, context):
return key[1:-1]
if key in string.digits:
return int(key)
return context[key]
return context.get(key, None)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
author_email='scott.walton@mypebble.co.uk',
description='A simple, customisable, feature flipper',
url='https://github.com/mypebble/django-feature-flipper.git',
version='0.0.7',
version='0.0.8',
packages=find_packages(),
license='MIT',
long_description=LONG_DESCRIPTION,
Expand Down