mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-24 11:38:39 +02:00
Update domain.py
This commit is contained in:
parent
7ba71f4f2c
commit
a9509ebdce
1 changed files with 1 additions and 0 deletions
|
@ -1969,6 +1969,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
# If we find duplicates, log it and delete the newest one.
|
||||
if db_contact.count() > 1:
|
||||
logger.warning("_get_or_create_public_contact() -> Duplicate contacts found. Deleting duplicate.")
|
||||
# Q: Should we be deleting the newest or the oldest? Does it even matter?
|
||||
newest_duplicate = db_contact.order_by('-created_at').first()
|
||||
newest_duplicate.delete()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue