handled edit for domain application

This commit is contained in:
David Kennedy 2024-01-12 08:02:42 -05:00
parent a213264fff
commit 4dae5ee23e
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B

View file

@ -199,6 +199,12 @@ class RegistrarFormSet(forms.BaseFormSet):
else:
# If there are no other relationships, delete the object
db_obj.delete()
else:
if any(self.has_more_than_one_join(db_obj, rel, related_name) for rel in reverse_joins):
# create a new db_obj and disconnect existing one
getattr(db_obj, related_name).remove(self.application)
kwargs = pre_create(db_obj, cleaned)
getattr(obj, join).create(**kwargs)
else:
pre_update(db_obj, cleaned)
db_obj.save()