mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 17:47:02 +02:00
Merge remote-tracking branch 'origin/main' into rjm/757-action-needed-759-rejected
This commit is contained in:
commit
267f76eb62
8 changed files with 34 additions and 32 deletions
12
src/package-lock.json
generated
12
src/package-lock.json
generated
|
@ -4086,9 +4086,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/normalize-package-data/node_modules/semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
|
@ -10148,9 +10148,9 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -280,7 +280,7 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
|||
# for the side effects (like an email send). Same
|
||||
# comment applies to original_obj method calls below.
|
||||
original_obj.submit(updated_domain_application=obj)
|
||||
elif obj.status == models.DomainApplication.INVESTIGATING:
|
||||
elif obj.status == models.DomainApplication.IN_REVIEW:
|
||||
original_obj.in_review(updated_domain_application=obj)
|
||||
elif obj.status == models.DomainApplication.ACTION_NEEDED:
|
||||
original_obj.action_needed(updated_domain_application=obj)
|
||||
|
|
|
@ -202,11 +202,11 @@ class DomainApplicationFixture:
|
|||
"organization_name": "Example - Submitted but pending Investigation",
|
||||
},
|
||||
{
|
||||
"status": "investigating",
|
||||
"status": "in review",
|
||||
"organization_name": "Example - In Investigation",
|
||||
},
|
||||
{
|
||||
"status": "investigating",
|
||||
"status": "in review",
|
||||
"organization_name": "Example - Approved",
|
||||
},
|
||||
{
|
||||
|
@ -378,9 +378,9 @@ class DomainFixture(DomainApplicationFixture):
|
|||
return
|
||||
|
||||
for user in users:
|
||||
# approve one of each users investigating status domains
|
||||
# approve one of each users in review status domains
|
||||
application = DomainApplication.objects.filter(
|
||||
creator=user, status=DomainApplication.INVESTIGATING
|
||||
creator=user, status=DomainApplication.IN_REVIEW
|
||||
).last()
|
||||
logger.debug(f"Approving {application} for {user}")
|
||||
application.approve()
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
# Generated by Django 4.2.2 on 2023-07-12 21:31
|
||||
# Generated by Django 4.2.2 on 2023-07-13 17:56
|
||||
# hand merged
|
||||
|
||||
from django.db import migrations
|
||||
import django_fsm
|
||||
|
@ -17,7 +19,7 @@ class Migration(migrations.Migration):
|
|||
choices=[
|
||||
("started", "started"),
|
||||
("submitted", "submitted"),
|
||||
("investigating", "investigating"),
|
||||
("in review", "in review"),
|
||||
("action needed", "action needed"),
|
||||
("approved", "approved"),
|
||||
("withdrawn", "withdrawn"),
|
||||
|
|
|
@ -21,7 +21,7 @@ class DomainApplication(TimeStampedModel):
|
|||
# #### Constants for choice fields ####
|
||||
STARTED = "started"
|
||||
SUBMITTED = "submitted"
|
||||
INVESTIGATING = "investigating"
|
||||
IN_REVIEW = "in review"
|
||||
ACTION_NEEDED = "action needed"
|
||||
APPROVED = "approved"
|
||||
WITHDRAWN = "withdrawn"
|
||||
|
@ -29,7 +29,7 @@ class DomainApplication(TimeStampedModel):
|
|||
STATUS_CHOICES = [
|
||||
(STARTED, STARTED),
|
||||
(SUBMITTED, SUBMITTED),
|
||||
(INVESTIGATING, INVESTIGATING),
|
||||
(IN_REVIEW, IN_REVIEW),
|
||||
(ACTION_NEEDED, ACTION_NEEDED),
|
||||
(APPROVED, APPROVED),
|
||||
(WITHDRAWN, WITHDRAWN),
|
||||
|
@ -544,7 +544,7 @@ class DomainApplication(TimeStampedModel):
|
|||
"emails/submission_confirmation_subject.txt",
|
||||
)
|
||||
|
||||
@transition(field="status", source=SUBMITTED, target=INVESTIGATING)
|
||||
@transition(field="status", source=SUBMITTED, target=IN_REVIEW)
|
||||
def in_review(self, updated_domain_application):
|
||||
"""Investigate an application that has been submitted.
|
||||
|
||||
|
@ -561,7 +561,7 @@ class DomainApplication(TimeStampedModel):
|
|||
"emails/status_change_in_review_subject.txt",
|
||||
)
|
||||
|
||||
@transition(field="status", source=[INVESTIGATING, REJECTED], target=ACTION_NEEDED)
|
||||
@transition(field="status", source=[IN_REVIEW, REJECTED], target=ACTION_NEEDED)
|
||||
def action_needed(self, updated_domain_application):
|
||||
"""Send back an application that is under investigation or rejected.
|
||||
|
||||
|
@ -574,7 +574,7 @@ class DomainApplication(TimeStampedModel):
|
|||
)
|
||||
|
||||
@transition(
|
||||
field="status", source=[SUBMITTED, INVESTIGATING, REJECTED], target=APPROVED
|
||||
field="status", source=[SUBMITTED, IN_REVIEW, REJECTED], target=APPROVED
|
||||
)
|
||||
def approve(self, updated_domain_application=None):
|
||||
"""Approve an application that has been submitted.
|
||||
|
@ -621,7 +621,7 @@ class DomainApplication(TimeStampedModel):
|
|||
"emails/status_change_approved_subject.txt",
|
||||
)
|
||||
|
||||
@transition(field="status", source=[SUBMITTED, INVESTIGATING], target=WITHDRAWN)
|
||||
@transition(field="status", source=[SUBMITTED, IN_REVIEW], target=WITHDRAWN)
|
||||
def withdraw(self):
|
||||
"""Withdraw an application that has been submitted."""
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
Status:
|
||||
</span>
|
||||
{% if domainapplication.status == 'approved' %} Approved
|
||||
{% elif domainapplication.status == 'investigating' %} In Review
|
||||
{% elif domainapplication.status == 'in review' %} In Review
|
||||
{% elif domainapplication.status == 'rejected' %} Rejected
|
||||
{% elif domainapplication.status == 'submitted' %} Received
|
||||
{% else %}ERROR Please contact technical support/dev
|
||||
|
|
|
@ -83,7 +83,7 @@ class TestDomainApplicationAdmin(TestCase):
|
|||
model_admin = DomainApplicationAdmin(DomainApplication, self.site)
|
||||
|
||||
# Modify the application's property
|
||||
application.status = DomainApplication.INVESTIGATING
|
||||
application.status = DomainApplication.IN_REVIEW
|
||||
|
||||
# Use the model admin's save_model method
|
||||
model_admin.save_model(request, application, form=None, change=True)
|
||||
|
@ -118,7 +118,7 @@ class TestDomainApplicationAdmin(TestCase):
|
|||
|
||||
with boto3_mocking.clients.handler_for("sesv2", mock_client):
|
||||
# Create a sample application
|
||||
application = completed_application(status=DomainApplication.INVESTIGATING)
|
||||
application = completed_application(status=DomainApplication.IN_REVIEW)
|
||||
|
||||
# Create a mock request
|
||||
request = self.factory.post(
|
||||
|
|
|
@ -144,11 +144,11 @@ class TestDomainApplication(TestCase):
|
|||
with self.assertRaises(TransitionNotAllowed):
|
||||
application.submit()
|
||||
|
||||
def test_transition_not_allowed_investigating_submitted(self):
|
||||
"""Create an application with status investigating and call submit
|
||||
def test_transition_not_allowed_in_review_submitted(self):
|
||||
"""Create an application with status in review and call submit
|
||||
against transition rules"""
|
||||
|
||||
application = completed_application(status=DomainApplication.INVESTIGATING)
|
||||
application = completed_application(status=DomainApplication.IN_REVIEW)
|
||||
|
||||
with self.assertRaises(TransitionNotAllowed):
|
||||
application.submit()
|
||||
|
@ -171,7 +171,7 @@ class TestDomainApplication(TestCase):
|
|||
with self.assertRaises(TransitionNotAllowed):
|
||||
application.submit()
|
||||
|
||||
def test_transition_not_allowed_started_investigating(self):
|
||||
def test_transition_not_allowed_started_in_review(self):
|
||||
"""Create an application with status started and call in_review
|
||||
against transition rules"""
|
||||
|
||||
|
@ -180,16 +180,16 @@ class TestDomainApplication(TestCase):
|
|||
with self.assertRaises(TransitionNotAllowed):
|
||||
application.in_review()
|
||||
|
||||
def test_transition_not_allowed_investigating_investigating(self):
|
||||
"""Create an application with status investigating and call in_review
|
||||
def test_transition_not_allowed_in_review_in_review(self):
|
||||
"""Create an application with status in review and call in_review
|
||||
against transition rules"""
|
||||
|
||||
application = completed_application(status=DomainApplication.INVESTIGATING)
|
||||
application = completed_application(status=DomainApplication.IN_REVIEW)
|
||||
|
||||
with self.assertRaises(TransitionNotAllowed):
|
||||
application.in_review()
|
||||
|
||||
def test_transition_not_allowed_approved_investigating(self):
|
||||
def test_transition_not_allowed_approved_in_review(self):
|
||||
"""Create an application with status approved and call in_review
|
||||
against transition rules"""
|
||||
|
||||
|
@ -198,7 +198,7 @@ class TestDomainApplication(TestCase):
|
|||
with self.assertRaises(TransitionNotAllowed):
|
||||
application.in_review()
|
||||
|
||||
def test_transition_not_allowed_action_needed_investigating(self):
|
||||
def test_transition_not_allowed_action_needed_in_review(self):
|
||||
"""Create an application with status action needed and call in_review
|
||||
against transition rules"""
|
||||
|
||||
|
@ -207,7 +207,7 @@ class TestDomainApplication(TestCase):
|
|||
with self.assertRaises(TransitionNotAllowed):
|
||||
application.in_review()
|
||||
|
||||
def test_transition_not_allowed_rejected_investigating(self):
|
||||
def test_transition_not_allowed_rejected_in_review(self):
|
||||
"""Create an application with status rejected and call in_review
|
||||
against transition rules"""
|
||||
|
||||
|
@ -216,7 +216,7 @@ class TestDomainApplication(TestCase):
|
|||
with self.assertRaises(TransitionNotAllowed):
|
||||
application.in_review()
|
||||
|
||||
def test_transition_not_allowed_withdrawn_investigating(self):
|
||||
def test_transition_not_allowed_withdrawn_in_review(self):
|
||||
"""Create an application with status withdrawn and call in_review
|
||||
against transition rules"""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue