This commit is contained in:
rachidatecs 2023-08-24 19:09:57 -04:00
parent 4b82f5e131
commit 91d1b9c1cc
No known key found for this signature in database
GPG key ID: 3CEBBFA7325E5525
10 changed files with 218 additions and 155 deletions

View file

@ -35,7 +35,7 @@ class DomainApplication(TimeStampedModel):
(APPROVED, APPROVED),
(WITHDRAWN, WITHDRAWN),
(REJECTED, REJECTED),
(INELIGIBLE, INELIGIBLE)
(INELIGIBLE, INELIGIBLE),
]
class StateTerritoryChoices(models.TextChoices):
@ -556,7 +556,9 @@ class DomainApplication(TimeStampedModel):
)
@transition(
field="status", source=[SUBMITTED, IN_REVIEW, REJECTED, INELIGIBLE], target=APPROVED
field="status",
source=[SUBMITTED, IN_REVIEW, REJECTED, INELIGIBLE],
target=APPROVED,
)
def approve(self):
"""Approve an application that has been submitted.
@ -604,7 +606,7 @@ class DomainApplication(TimeStampedModel):
"emails/status_change_rejected.txt",
"emails/status_change_rejected_subject.txt",
)
@transition(field="status", source=[IN_REVIEW, APPROVED], target=INELIGIBLE)
def reject_with_prejudice(self):
"""The applicant is a bad actor, reject with prejudice.
@ -613,11 +615,9 @@ class DomainApplication(TimeStampedModel):
any existing domains/applications and from submitting new aplications.
We do this by setting an ineligible status on the user, which the
permissions classes test against"""
self.creator.block_user()
# ## Form policies ###
#
# These methods control what questions need to be answered by applicants