You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the primary key is 0 the _is_saved method will always return false, even though 0 is a valid value for a primary key field.
I would recommend changing this line:
from if not self.pk or self._mpttfield('tree_id') is None: to if self.pk not None or self._mpttfield('tree_id') is None: or if (not self.pk and self.pk not 0) or self._mpttfield('tree_id') is None:
The text was updated successfully, but these errors were encountered:
When the primary key is 0 the _is_saved method will always return false, even though 0 is a valid value for a primary key field.
I would recommend changing this line:
django-mptt/mptt/models.py
Line 803 in 32a5ecc
if not self.pk or self._mpttfield('tree_id') is None:
toif self.pk not None or self._mpttfield('tree_id') is None:
orif (not self.pk and self.pk not 0) or self._mpttfield('tree_id') is None:
The text was updated successfully, but these errors were encountered: