From d84f7fbb0e8a88efa0b85930cc5e4daad07a8e4b Mon Sep 17 00:00:00 2001 From: David Kennedy Date: Mon, 11 Dec 2023 17:26:00 -0500 Subject: [PATCH] wip --- src/registrar/templates/domain_detail.html | 6 +++++ .../templates/includes/domain_dates.html | 5 ++++ src/registrar/views/domain.py | 23 +++++++++++++------ 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 src/registrar/templates/includes/domain_dates.html diff --git a/src/registrar/templates/domain_detail.html b/src/registrar/templates/domain_detail.html index 81a350f82..7522d0892 100644 --- a/src/registrar/templates/domain_detail.html +++ b/src/registrar/templates/domain_detail.html @@ -27,6 +27,12 @@
+ +
+ Expires: {{ expiration_date }} + Date created: {{ creation_date }} +
+ {% url 'domain-dns-nameservers' pk=domain.id as url %} {% if domain.nameservers|length > 0 %} {% include "includes/summary_item.html" with title='DNS name servers' domains='true' value=domain.nameservers list='true' edit_link=url editable=domain.is_editable %} diff --git a/src/registrar/templates/includes/domain_dates.html b/src/registrar/templates/includes/domain_dates.html new file mode 100644 index 000000000..0949ea3f4 --- /dev/null +++ b/src/registrar/templates/includes/domain_dates.html @@ -0,0 +1,5 @@ + +
+ Expires: {{ expiration_date }} + Date created: {{ creation_date }} +
diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 81f1d0bb7..daf10bf90 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -142,14 +142,23 @@ class DomainView(DomainBaseView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - default_email = self.object.get_default_security_contact().email - context["default_security_email"] = default_email + try: + default_email = self.object.get_default_security_contact().email + context["default_security_email"] = default_email + + security_email = self.object.get_security_email() + if security_email is None or security_email == default_email: + context["security_email"] = None + return context + context["security_email"] = security_email + + context["expiration_date"] = self.object.registry_expiration_date + context["creation_date"] = self.object.creation_date + except: + log.warning(err) + context["expiration_date"] = datetime.strptime("2019-01-01", "%Y-%m-%d") + context["creation_date"] = datetime.strptime("2015-01-01", "%Y-%m-%d") - security_email = self.object.get_security_email() - if security_email is None or security_email == default_email: - context["security_email"] = None - return context - context["security_email"] = security_email return context def in_editable_state(self, pk):