Skip to content

Conversation

@tpict
Copy link
Contributor

@tpict tpict commented Dec 5, 2016

This PR stops feature-flipper from throwing a KeyError exception when the template tag's "user identifier" argument isn't contained in the page context

if key in string.digits:
return int(key)
return context[key]
return context.get(key, False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is depending on the fact that False is 0 in Python 2 (which doesn't hold for Python 3). You'd be best changing this round a bit so there's a concept of there being no value at all here, then passing that information to the render method somehow.

If _get_value hasn't got a valid key then it shouldn't call show_feature at all.

@scott-w scott-w merged commit 71a3fdf into mypebble:master Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants