mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-27 21:16:28 +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
|
"""creates a disclose object that can be added to a contact Create using
|
||||||
.disclose= <this function> on the command before sending.
|
.disclose= <this function> on the command before sending.
|
||||||
if item is security email then make sure email is visable"""
|
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
|
DF = epp.DiscloseField
|
||||||
fields = {DF.FAX, DF.VOICE, DF.ADDR}
|
fields = {DF.EMAIL}
|
||||||
|
disclose = (
|
||||||
if not isSecurity or (
|
is_security and contact.email != PublicContact.get_default_security().email
|
||||||
isSecurity and contact.email == PublicContact.get_default_security().email
|
)
|
||||||
):
|
|
||||||
fields.add(DF.EMAIL)
|
|
||||||
return epp.Disclose(
|
return epp.Disclose(
|
||||||
flag=False,
|
flag=disclose,
|
||||||
fields=fields,
|
fields=fields,
|
||||||
types={DF.ADDR: "loc"},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def _make_epp_contact_postal_info(self, contact: PublicContact): # type: ignore
|
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
|
self, contact: PublicContact, disclose_email=False, createContact=True
|
||||||
):
|
):
|
||||||
DF = common.DiscloseField
|
DF = common.DiscloseField
|
||||||
fields = {DF.FAX, DF.VOICE, DF.ADDR}
|
fields = {DF.EMAIL}
|
||||||
|
|
||||||
if not disclose_email:
|
|
||||||
fields.add(DF.EMAIL)
|
|
||||||
|
|
||||||
di = common.Disclose(
|
di = common.Disclose(
|
||||||
flag=False,
|
flag=disclose_email,
|
||||||
fields=fields,
|
fields=fields,
|
||||||
types={DF.ADDR: "loc"},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# check docs here looks like we may have more than one address field but
|
# 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