mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-31 01:33:56 +02:00
Linting, fix domain.py
This commit is contained in:
parent
19af42ca49
commit
4110b37865
2 changed files with 6 additions and 4 deletions
|
@ -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):
|
||||
|
|
|
@ -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"""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue