diff --git a/apis_core/apis_relations/forms.py b/apis_core/apis_relations/forms.py index d327af1..1064a8e 100644 --- a/apis_core/apis_relations/forms.py +++ b/apis_core/apis_relations/forms.py @@ -4,7 +4,6 @@ from crispy_forms.helper import FormHelper from django import forms -from apis_core.apis_entities.models import Place from apis_core.apis_labels.models import Label from apis_core.helper_functions import DateParser diff --git a/apis_core/apis_relations/forms2.py b/apis_core/apis_relations/forms2.py index f7b1a5e..c5d099c 100644 --- a/apis_core/apis_relations/forms2.py +++ b/apis_core/apis_relations/forms2.py @@ -65,6 +65,8 @@ def save(self, site_instance, instance=None, commit=True): x = self.relation_form.objects.get(pk=instance) else: x = self.relation_form() + if f"{site_instance.id}" == f'{cd["target"]}': + return x x.relation_type_id = cd["relation_type"] x.start_date_written = cd["start_date_written"] x.end_date_written = cd["end_date_written"]