From db19ac0abdc35a946827c01c60093e38ab9feb31 Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Wed, 8 May 2024 12:40:23 +0200 Subject: [PATCH] fix(apis_entities): remove self from list of entities to merge with --- apis_core/apis_entities/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apis_core/apis_entities/models.py b/apis_core/apis_entities/models.py index a328635f8..645ecd4cb 100644 --- a/apis_core/apis_entities/models.py +++ b/apis_core/apis_entities/models.py @@ -151,6 +151,8 @@ def merge_fields(self, other): self.save() def merge_with(self, entities): + if self in entities: + entities.remove(self) origin = self.__class__ signals.pre_merge_with.send(sender=origin, instance=self, entities=entities)