mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-24 03:30:50 +02:00
Don't display default sec email
This commit is contained in:
parent
64f3adc443
commit
d645c2fbaa
3 changed files with 22 additions and 3 deletions
|
@ -603,7 +603,10 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
def get_security_email(self):
|
||||
logger.info("get_security_email-> getting the contact ")
|
||||
secContact = self.security_contact
|
||||
return secContact.email
|
||||
if secContact is not None:
|
||||
return secContact.email
|
||||
else:
|
||||
return None
|
||||
|
||||
def clientHoldStatus(self):
|
||||
return epp.Status(state=self.Status.CLIENT_HOLD, description="", lang="en")
|
||||
|
|
|
@ -46,7 +46,12 @@
|
|||
{% include "includes/summary_item.html" with title='Your contact information' value=request.user.contact contact='true' edit_link=url %}
|
||||
|
||||
{% url 'domain-security-email' pk=domain.id as url %}
|
||||
{% include "includes/summary_item.html" with title='Security email' value=domain.security_contact.email edit_link=url %}
|
||||
{% if security_email is not None and security_email != "dotgov@cisa.dhs.gov"%}
|
||||
{% include "includes/summary_item.html" with title='Security email' value=security_email edit_link=url %}
|
||||
{% else %}
|
||||
{% include "includes/summary_item.html" with title='Security email' value=None edit_link=url %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% url 'domain-users' pk=domain.id as url %}
|
||||
{% include "includes/summary_item.html" with title='User management' users='true' list=True value=domain.permissions.all edit_link=url %}
|
||||
|
|
|
@ -29,9 +29,20 @@ class DomainPermissionView(DomainPermission, DetailView, abc.ABC):
|
|||
# variable name in template context for the model object
|
||||
context_object_name = "domain"
|
||||
|
||||
# Adds context information for user permissions
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.security_email = None
|
||||
|
||||
def get_object(self, queryset=None):
|
||||
obj = super().get_object(queryset)
|
||||
self.security_email = obj.get_security_email()
|
||||
return obj
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
# Store the security email
|
||||
context["security_email"] = self.security_email
|
||||
# Adds context information for user permissions
|
||||
user = self.request.user
|
||||
context["is_analyst_or_superuser"] = user.is_staff or user.is_superuser
|
||||
# Stored in a variable for the linter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue