mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-03 16:32:15 +02:00
Bug fix for duplicate PublicContacts
This commit is contained in:
parent
83d1a278f7
commit
4fea8555f0
1 changed files with 4 additions and 0 deletions
|
@ -537,6 +537,10 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
self._update_domain_with_contact(contact=contact, rem=False)
|
||||
# if already exists just update
|
||||
elif alreadyExistsInRegistry:
|
||||
old_contact = PublicContact.objects.filter(registry_id=contact.registry_id, contact_type=contact.contact_type).exclude(domain=self)
|
||||
if(old_contact.count > 0){
|
||||
old_contact.delete()
|
||||
}
|
||||
current_contact = PublicContact.objects.filter(
|
||||
registry_id=contact.registry_id
|
||||
).get()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue