Update domain.py

This commit is contained in:
zandercymatics 2024-05-02 12:10:01 -06:00
parent 7ba71f4f2c
commit a9509ebdce
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -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()