From a quick test, it seems that `{% x is not None %}` is currently
evaluated as `x is (not None)`, instead of `x is not None`.
Discussion on django-developers mailing list:
https://groups.google.com/d/msg/django-developers/jYdYCAtHHdw/WJYNXqAzEwAJ
--
Ticket URL: <https://code.djangoproject.com/ticket/26479>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* needs_better_patch: => 0
* owner: nobody => alasdairnicol
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/26479#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/26479#comment:2>
* has_patch: 0 => 1
Comment:
Pull request https://github.com/django/django/pull/6436/files
--
Ticket URL: <https://code.djangoproject.com/ticket/26479#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c16b9dd8e0ae757616e9accbaffecc521191ee98" c16b9dd]:
{{{
#!CommitTicketReference repository=""
revision="c16b9dd8e0ae757616e9accbaffecc521191ee98"
Fixed #26479 -- Added 'is not' operator to the if tag.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26479#comment:4>
* status: closed => new
* resolution: fixed =>
Comment:
Re-opening because I think we should we document (and add tests) for when
either or both of the variables are not in the template context.
As an aside, I can't see any tests for the != operator in the
[https://github.com/django/django/blob/c16b9dd8e0ae757616e9accbaffecc521191ee98/tests/template_tests/syntax_tests/test_if.py
test_if.py]. If I haven't overlooked them and they are missing, we could
open a separate ticket to add them.
--
Ticket URL: <https://code.djangoproject.com/ticket/26479#comment:5>
* has_patch: 1 => 0
Comment:
#17664 "{% if %} template tag silences exceptions inconsistently" and a
couple related tickets might be relevant to that.
--
Ticket URL: <https://code.djangoproject.com/ticket/26479#comment:6>
* has_patch: 0 => 1
Comment:
New pull request: https://github.com/django/django/pull/6532
I had a quick look at #17664, but I wasn't sure what I should do for this
ticket. If more changes/test cases related to unhandled exceptions are
required, I think somebody else will have to take over the ticket.
--
Ticket URL: <https://code.djangoproject.com/ticket/26479#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"dac075e9103ba961af4f70b4011616daa72985d4" dac075e]:
{{{
#!CommitTicketReference repository=""
revision="dac075e9103ba961af4f70b4011616daa72985d4"
Refs #26479 -- Documented is/is not if tag operator behavior for
nonexistent variables.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26479#comment:8>
* status: new => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/26479#comment:9>