Merge branch 'main' into dk/1016-nameservers-ui

This commit is contained in:
David Kennedy 2023-10-23 21:47:48 -04:00
commit 0e95ff6478
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
32 changed files with 738 additions and 145 deletions

View file

@ -1416,18 +1416,16 @@ class Domain(TimeStampedModel, DomainHelper):
"""creates a disclose object that can be added to a contact Create using
.disclose= <this function> on the command before sending.
if item is security email then make sure email is visable"""
isSecurity = contact.contact_type == contact.ContactTypeChoices.SECURITY
is_security = contact.contact_type == contact.ContactTypeChoices.SECURITY
DF = epp.DiscloseField
fields = {DF.FAX, DF.VOICE, DF.ADDR}
if not isSecurity or (
isSecurity and contact.email == PublicContact.get_default_security().email
):
fields.add(DF.EMAIL)
fields = {DF.EMAIL}
disclose = (
is_security and contact.email != PublicContact.get_default_security().email
)
# Will only disclose DF.EMAIL if its not the default
return epp.Disclose(
flag=False,
flag=disclose,
fields=fields,
types={DF.ADDR: "loc"},
)
def _make_epp_contact_postal_info(self, contact: PublicContact): # type: ignore