fix: base basemodel handle_parent 处理bug
This commit is contained in:
parent
ac6fd28aba
commit
b57fd16d5a
|
@ -124,6 +124,9 @@ class BaseModel(models.Model):
|
||||||
old_parent = None
|
old_parent = None
|
||||||
need_handle_parent = False
|
need_handle_parent = False
|
||||||
if hasattr(self, "parent"):
|
if hasattr(self, "parent"):
|
||||||
|
if is_create:
|
||||||
|
need_handle_parent = True
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
old_parent = self.__class__.objects.get(id=self.id).parent
|
old_parent = self.__class__.objects.get(id=self.id).parent
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
Loading…
Reference in New Issue