mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 17:17:02 +02:00
Test
This commit is contained in:
parent
8d43031d75
commit
9583dbca94
3 changed files with 12 additions and 8 deletions
|
@ -1749,12 +1749,11 @@ class DomainAdmin(ListHeaderAdmin):
|
|||
if domain is not None and hasattr(domain, "domain_info"):
|
||||
extra_context["original_object"] = domain.domain_info
|
||||
|
||||
logger.info(f"changeform_view() -> state is {domain.state}")
|
||||
extra_context["state_help_message"] = Domain.State.get_admin_help_text(domain.state)
|
||||
logger.info(f"changeform_view() -> state is now {domain.state}")
|
||||
extra_context["domain_state"] = domain.state
|
||||
|
||||
# Pass in what the an extended expiration date would be for the expiration date modal
|
||||
self._set_expiration_date_context(domain, extra_context)
|
||||
logger.info(f"changeform_view() -> state is now actually {domain.state}")
|
||||
|
||||
return super().changeform_view(request, object_id, form_url, extra_context)
|
||||
|
||||
|
|
|
@ -278,7 +278,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
"""Get or set the `ex_date` element from the registry.
|
||||
Additionally, _get_property updates the expiration date in the registrar"""
|
||||
try:
|
||||
return self._get_property("ex_date", False)
|
||||
return self._get_property("ex_date")
|
||||
except Exception as e:
|
||||
# exception raised during the save to registrar
|
||||
logger.error(f"error updating expiration date in registrar: {e}")
|
||||
|
@ -1770,7 +1770,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
technical_contact = self.get_default_technical_contact()
|
||||
technical_contact.save()
|
||||
|
||||
def _fetch_cache(self, fetch_hosts=False, fetch_contacts=False, fix_unknown=True):
|
||||
def _fetch_cache(self, fetch_hosts=False, fetch_contacts=False):
|
||||
"""Contact registry for info about a domain."""
|
||||
try:
|
||||
data_response = self._get_or_create_domain()
|
||||
|
@ -1778,7 +1778,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
cleaned = self._clean_cache(cache, data_response)
|
||||
self._update_hosts_and_contacts(cleaned, fetch_hosts, fetch_contacts)
|
||||
|
||||
if self.state == self.State.UNKNOWN and fix_unknown:
|
||||
if self.state == self.State.UNKNOWN:
|
||||
self._fix_unknown_state(cleaned)
|
||||
if fetch_hosts:
|
||||
self._update_hosts_and_ips_in_db(cleaned)
|
||||
|
@ -2008,13 +2008,12 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
"""Remove cache data when updates are made."""
|
||||
self._cache = {}
|
||||
|
||||
def _get_property(self, property, fix_unknown=True):
|
||||
def _get_property(self, property):
|
||||
"""Get some piece of info about a domain."""
|
||||
if property not in self._cache:
|
||||
self._fetch_cache(
|
||||
fetch_hosts=(property == "hosts"),
|
||||
fetch_contacts=(property == "contacts"),
|
||||
fix_unknown=fix_unknown,
|
||||
)
|
||||
|
||||
if property in self._cache:
|
||||
|
|
|
@ -2,6 +2,12 @@
|
|||
{% load static url_helpers %}
|
||||
|
||||
|
||||
{% block field_readonly %}
|
||||
{% if field.field.name == "state" %}
|
||||
<div class="readonly">{{ domain_state }}</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block help_text %}
|
||||
<div class="help margin-bottom-1" {% if field.field.id_for_label %} id="{{ field.field.id_for_label }}_helptext"{% endif %}>
|
||||
{% if field.field.name == "state" %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue