added withdrawn as new status and migrations

This commit is contained in:
Jon Roberts 2023-04-13 12:34:29 -06:00
parent 2df5ecb193
commit 75b5cc977b
No known key found for this signature in database
GPG key ID: EED093582198B041
4 changed files with 58 additions and 1 deletions

View file

@ -23,11 +23,13 @@ class DomainApplication(TimeStampedModel):
SUBMITTED = "submitted"
INVESTIGATING = "investigating"
APPROVED = "approved"
WITHDRAWN = "Withdrawn"
STATUS_CHOICES = [
(STARTED, STARTED),
(SUBMITTED, SUBMITTED),
(INVESTIGATING, INVESTIGATING),
(APPROVED, APPROVED),
(WITHDRAWN, WITHDRAWN)
]
class StateTerritoryChoices(models.TextChoices):
@ -505,7 +507,7 @@ class DomainApplication(TimeStampedModel):
# This is a side-effect of the state transition
self._send_confirmation_email()
@transition(field="status", source=[SUBMITTED, INVESTIGATING], target=APPROVED)
@transition(field="status", source=[SUBMITTED, INVESTIGATING], target=[APPROVED])
def approve(self):
"""Approve an application that has been submitted.