some refactors in relations module

This commit is contained in:
collerek
2020-09-15 13:53:54 +02:00
parent df9b5d27da
commit b47d5209eb
4 changed files with 18 additions and 17 deletions

View File

@ -39,7 +39,7 @@ class Relation:
def _find_existing(self, child: "Model") -> Optional[int]:
for ind, relation_child in enumerate(self.related_models[:]):
try:
if relation_child.__same__(child):
if relation_child == child:
return ind
except ReferenceError: # pragma no cover
self.related_models.pop(ind)