#18979: PermWrapper + template "if in" interaction
-------------------------------------------+------------------------
               Reporter:  akaariai         |          Owner:  nobody
                   Type:  Bug              |         Status:  new
              Component:  Template system  |        Version:  1.4
               Severity:  Normal           |       Keywords:
           Triage Stage:  Unreviewed       |      Has patch:  0
    Needs documentation:  0                |    Needs tests:  0
Patch needs improvement:  0                |  Easy pickings:  0
                  UI/UX:  0                |
-------------------------------------------+------------------------
 Trying to do
 {{{
 {% if 'someperm' in perms.someapp %}has perm{% else %}no perm{% endif %}
 }}}
 will result in endless loop. Above, the perms is !PermWrapper as installed
 by the !RequestContext.

 Doing {{{ if perms.someapp.someperm }}} works correctly. I tried the above
 because I have a permission codename (from external database) which
 contains '-', so I can't use the documented syntax.

 The attached tester project shows this error. run devserver, click the
 link, and you will have the dev-server in endless loop which isn't even
 killable by Ctrl-c... So, be prepared to kill the server by force.

 I know the above isn't documented use of !PermWrapper. But, to me it seems
 this bug isn't a !PermWrapper bug, what it does looks sane to me. So, I am
 suspecting there could be some underlying bug in the template engine. So,
 I am marking this into Template system, though the bug could be elsewhere,
 too.

 Tested with 1.4.1 and 1.5.dev20120918050907 with Python 2.7.3.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18979>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to