Closed smulloni closed 14 years ago
Thanks for the fix. That should definitely be an identity test, rather than a truth test.
I had a little trouble reproducing your problem; it seems to only come up when you initialize an instance with the default position and then explicitly set it to zero before saving. I finally tracked it down and added a test for it in b8cf3ca47e1a8052754cd1b27eb7114c3e6b95e9.
At the moment, if you add a new item with position 0, the new item is added at the end as if one had entered -1. This is because the "updated" variable in pre_save is evaluated as a boolean at one point rather than checking if it is None.
Here's the one-line fix. I'd really appreciate a merge -- thanks!