diff --git a/src/registrar/models/domain.py b/src/registrar/models/domain.py index 233e619b3..ca1ba541a 100644 --- a/src/registrar/models/domain.py +++ b/src/registrar/models/domain.py @@ -1418,14 +1418,16 @@ class Domain(TimeStampedModel, DomainHelper): def get_state_help_text(self) -> str: """Returns a str containing additional information about a given state. Returns custom content for when the domain itself is expired.""" - if not self.is_expired() and self.state != self.State.UNKNOWN: - help_text = Domain.State.get_help_text(self.state) - else: + + if self.is_expired() and self.state != self.State.UNKNOWN: # Given expired is not a physical state, but it is displayed as such, # We need custom logic to determine this message. help_text = ( "This domain has expired, but it is still online. " "To renew this domain, contact help@get.gov." ) + else: + help_text = Domain.State.get_help_text(self.state) + return help_text def _disclose_fields(self, contact: PublicContact): diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index 666b3c962..2ba762b0e 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -170,7 +170,7 @@ class LoggedInTests(TestWithUser): # Check that we have the right text content. self.assertContains(response, expired_text, count=1) - + def test_state_help_text_no_expiration_date(self): """Tests if each domain state has help text when expiration date is None"""