mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 12:38:36 +02:00
#1102 - Changed disclose behaviour
This commit is contained in:
parent
4fa5f6d097
commit
67d177dc75
2 changed files with 8 additions and 15 deletions
|
@ -850,18 +850,15 @@ 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
|
||||
)
|
||||
return epp.Disclose(
|
||||
flag=False,
|
||||
flag=disclose,
|
||||
fields=fields,
|
||||
types={DF.ADDR: "loc"},
|
||||
)
|
||||
|
||||
def _make_epp_contact_postal_info(self, contact: PublicContact): # type: ignore
|
||||
|
|
|
@ -626,15 +626,11 @@ class MockEppLib(TestCase):
|
|||
self, contact: PublicContact, disclose_email=False, createContact=True
|
||||
):
|
||||
DF = common.DiscloseField
|
||||
fields = {DF.FAX, DF.VOICE, DF.ADDR}
|
||||
|
||||
if not disclose_email:
|
||||
fields.add(DF.EMAIL)
|
||||
fields = {DF.EMAIL}
|
||||
|
||||
di = common.Disclose(
|
||||
flag=False,
|
||||
flag=disclose_email,
|
||||
fields=fields,
|
||||
types={DF.ADDR: "loc"},
|
||||
)
|
||||
|
||||
# check docs here looks like we may have more than one address field but
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue