mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 02:36:02 +02:00
Update domain.py
This commit is contained in:
parent
8f60631210
commit
ec26f03b44
1 changed files with 1 additions and 1 deletions
|
@ -1967,7 +1967,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
logger.warning("_get_or_create_public_contact() -> Duplicate contacts found. Deleting duplicate.")
|
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?
|
# Q: Should we be deleting the newest or the oldest? Does it even matter?
|
||||||
oldest_duplicate = db_contact.order_by("created_at")
|
oldest_duplicate = db_contact.order_by("created_at").first()
|
||||||
|
|
||||||
# Exclude the oldest entry
|
# Exclude the oldest entry
|
||||||
duplicates_to_delete = db_contact.exclude(id=oldest_duplicate.id)
|
duplicates_to_delete = db_contact.exclude(id=oldest_duplicate.id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue