Update domain.py

This commit is contained in:
zandercymatics 2025-03-21 07:40:14 -06:00
parent 130aedc58a
commit c3d3e49f71
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -971,6 +971,24 @@ class Domain(TimeStampedModel, DomainHelper):
logger.info("making technical contact")
self._set_singleton_contact(contact, expectedType=contact.ContactTypeChoices.TECHNICAL)
def print_contact_info_epp(self, contact: PublicContact):
"""Prints registry data for this PublicContact for easier debugging"""
results = self._request_contact_info(contact, get_result_as_dict=True)
logger.info("---------------------")
logger.info(f"EPP info for {contact.contact_type}:")
logger.info("---------------------")
for key, value in results.items():
logger.info(f"{key}: {value}")
def print_all_domain_contact_info_epp(self):
"""Prints registry data for this domains security, registrant, technical, and administrative contacts."""
logger.info(f"Contact info for {self}:")
logger.info("=====================")
contacts = [self.security_contact, self.registrant_contact, self.technical_contact, self.administrative_contact]
for contact in contacts:
if contact:
self.print_contact_info_epp(contact)
def is_active(self) -> bool:
"""Currently just returns if the state is created,
because then it should be live, theoretically.