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
|
@ -200,8 +200,14 @@ class RegistrarFormSet(forms.BaseFormSet):
|
||||||
# If there are no other relationships, delete the object
|
# If there are no other relationships, delete the object
|
||||||
db_obj.delete()
|
db_obj.delete()
|
||||||
else:
|
else:
|
||||||
pre_update(db_obj, cleaned)
|
if any(self.has_more_than_one_join(db_obj, rel, related_name) for rel in reverse_joins):
|
||||||
db_obj.save()
|
# 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()
|
||||||
|
|
||||||
# no matching database object, create it
|
# no matching database object, create it
|
||||||
# make sure not to create a database object if cleaned has 'delete' attribute
|
# make sure not to create a database object if cleaned has 'delete' attribute
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue