fix(core): dont attempt to access parent_object if 'None' during history save

!27
This commit is contained in:
2024-06-15 16:19:55 +09:30
parent b7a2bfc612
commit 54c34a95f5

View File

@ -85,8 +85,10 @@ class SaveHistory(models.Model):
if hasattr(self, 'parent_object'):
item_parent_pk = self.parent_object.pk
item_parent_class = self.parent_object._meta.model_name
if self.parent_object:
item_parent_pk = self.parent_object.pk
item_parent_class = self.parent_object._meta.model_name
item_pk = self.pk