django-mptt/django-mptt — Issue #163: is_leaf_node() returns wrong value
Author: tini
Created: 2011-12-01 16:06:10+00:00
State: open

I have an MPTT based model and I'm able to edit it in the Django Admin. I'll explain the problem with an example:

Say I have this existing tree:

root
- node1
- - node 2
- node 3

Now "node 2" is a leaf (is_leaf_node() returns True).

Then I insert "node 4" below "node 2":

root
- node1
- - node 2
- - - node 4
- node 3

Now "node 2" is not longer a leaf (is_leaf_node() returns False).
Now we delete "node 4":

root
- node1
- - node 2
- node 3

Not the problem is that "node 2" should again be a leaf, but "is_leaf_node()" still returns False.

Tested in 0.5.1 and 0.5.2.