Update domain.py

This commit is contained in:
zandercymatics 2024-05-03 12:21:30 -06:00
parent 8f60631210
commit ec26f03b44
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -1967,7 +1967,7 @@ class Domain(TimeStampedModel, DomainHelper):
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?
oldest_duplicate = db_contact.order_by("created_at")
oldest_duplicate = db_contact.order_by("created_at").first()
# Exclude the oldest entry
duplicates_to_delete = db_contact.exclude(id=oldest_duplicate.id)