mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 10:46:06 +02:00
Change ready_at to first_ready_at and make a unit test for it
This commit is contained in:
parent
1be00962ac
commit
92f17c437f
3 changed files with 40 additions and 8 deletions
|
@ -967,7 +967,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
help_text="Deleted at date",
|
||||
)
|
||||
|
||||
ready_at = DateField(
|
||||
first_ready_at = DateField(
|
||||
null=True,
|
||||
editable=False,
|
||||
help_text="The last time this domain moved into the READY state",
|
||||
|
@ -1336,7 +1336,11 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
"""
|
||||
logger.info("Changing to ready state")
|
||||
logger.info("able to transition to ready state")
|
||||
self.ready_at = timezone.now()
|
||||
# if self.first_ready_at is not None, this means that his
|
||||
# domain wasr READY, then not READY, then is READY again.
|
||||
# We do not want to overwrite first_ready_at.
|
||||
if self.first_ready_at is None:
|
||||
self.first_ready_at = timezone.now()
|
||||
|
||||
@transition(
|
||||
field="state",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue