disqus / gargoyle

Feature switches in Django
http://engineering.disqus.com
Apache License 2.0
746 stars 112 forks source link

{% ifswitch %} documentation vague on quoting #39

Open akaihola opened 12 years ago

akaihola commented 12 years ago

The documentation for {% ifswitch %} gives two examples. The first one doesn't quote the switch name:

{% ifswitch switch_name %}
    switch_name is active!
{% else %}
    switch_name is not active :(
{% endifswitch %}

whereas the second one does:

{% ifswitch "my switch name" user %}
    "my switch name" is active!
{% endifswitch %}

Based on a quick test and a brief look at the code for the template tag it seems that a quoted argument is not resolved against the template context, so the quotes are included in the switch name. A quoted switch name in the template tag doesn't match an unquoted switch name created in Nexus.

Strangely enough, a switch with a quoted name can't be created if a similarly named unquoted switch already exists.