mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-03 09:43:33 +02:00
handled edit for domain application
This commit is contained in:
parent
a213264fff
commit
4dae5ee23e
1 changed files with 8 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue