Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

{% ifswitch %} documentation vague on quoting #39

Open
akaihola opened this issue Apr 17, 2012 · 0 comments
Open

{% ifswitch %} documentation vague on quoting #39

akaihola opened this issue Apr 17, 2012 · 0 comments

Comments

@akaihola
Copy link
Contributor

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.

akaihola added a commit to akaihola/gargoyle that referenced this issue Apr 17, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant