mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 04:28:39 +02:00
merge main
This commit is contained in:
commit
2de0225aaf
6 changed files with 763 additions and 690 deletions
|
@ -4,7 +4,6 @@ Pull requests should be titled in the format of `#issue_number: Descriptive name
|
||||||
Pull requests including a migration should be suffixed with ` - MIGRATION`
|
Pull requests including a migration should be suffixed with ` - MIGRATION`
|
||||||
|
|
||||||
After creating a pull request, pull request submitters should:
|
After creating a pull request, pull request submitters should:
|
||||||
- Add at least 2 developers as PR reviewers (only 1 will need to approve).
|
|
||||||
- Message on Slack or in standup to notify the team that a PR is ready for review.
|
- Message on Slack or in standup to notify the team that a PR is ready for review.
|
||||||
- If any model was updated to modify/add/delete columns, run makemigrations and commit the associated migrations file.
|
- If any model was updated to modify/add/delete columns, run makemigrations and commit the associated migrations file.
|
||||||
|
|
||||||
|
|
1317
src/Pipfile.lock
generated
1317
src/Pipfile.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -2736,8 +2736,30 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def change_view(self, request, object_id, form_url="", extra_context=None):
|
def change_view(self, request, object_id, form_url="", extra_context=None):
|
||||||
"""Display restricted warning,
|
"""Display restricted warning, setup the auditlog trail and pass it in extra context,
|
||||||
Setup the auditlog trail and pass it in extra context."""
|
display warning that status cannot be changed from 'Approved' if domain is in Ready state"""
|
||||||
|
|
||||||
|
# Fetch the domain request instance
|
||||||
|
domain_request: models.DomainRequest = models.DomainRequest.objects.get(pk=object_id)
|
||||||
|
if domain_request.approved_domain and domain_request.approved_domain.state == models.Domain.State.READY:
|
||||||
|
domain = domain_request.approved_domain
|
||||||
|
# get change url for domain
|
||||||
|
app_label = domain_request.approved_domain._meta.app_label
|
||||||
|
model_name = domain._meta.model_name
|
||||||
|
obj_id = domain.id
|
||||||
|
change_url = reverse("admin:%s_%s_change" % (app_label, model_name), args=[obj_id])
|
||||||
|
|
||||||
|
message = format_html(
|
||||||
|
"The status of this domain request cannot be changed because it has been joined to a domain in Ready status: " # noqa: E501
|
||||||
|
"<a href='{}'>{}</a>",
|
||||||
|
mark_safe(change_url), # nosec
|
||||||
|
escape(str(domain)),
|
||||||
|
)
|
||||||
|
messages.warning(
|
||||||
|
request,
|
||||||
|
message,
|
||||||
|
)
|
||||||
|
|
||||||
obj = self.get_object(request, object_id)
|
obj = self.get_object(request, object_id)
|
||||||
self.display_restricted_warning(request, obj)
|
self.display_restricted_warning(request, obj)
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,7 @@
|
||||||
<ul class="usa-list">
|
<ul class="usa-list">
|
||||||
<li>Be available </li>
|
<li>Be available </li>
|
||||||
<li>Relate to your organization’s name, location, and/or services </li>
|
<li>Relate to your organization’s name, location, and/or services </li>
|
||||||
{% if portfolio %}
|
|
||||||
<li>Be clear to the general public. Your domain name must not be easily confused with other organizations.</li>
|
|
||||||
{% else %}
|
|
||||||
<li>Be unlikely to mislead or confuse the general public (even if your domain is only intended for a specific audience) </li>
|
<li>Be unlikely to mislead or confuse the general public (even if your domain is only intended for a specific audience) </li>
|
||||||
{% endif %}
|
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ from registrar.models import (
|
||||||
AllowedEmail,
|
AllowedEmail,
|
||||||
Suborganization,
|
Suborganization,
|
||||||
)
|
)
|
||||||
|
from registrar.models.host import Host
|
||||||
|
from registrar.models.public_contact import PublicContact
|
||||||
from .common import (
|
from .common import (
|
||||||
MockSESClient,
|
MockSESClient,
|
||||||
completed_domain_request,
|
completed_domain_request,
|
||||||
|
@ -39,7 +41,7 @@ from .common import (
|
||||||
MockEppLib,
|
MockEppLib,
|
||||||
GenericTestHelper,
|
GenericTestHelper,
|
||||||
)
|
)
|
||||||
from unittest.mock import patch
|
from unittest.mock import ANY, patch
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
import boto3_mocking # type: ignore
|
import boto3_mocking # type: ignore
|
||||||
|
@ -79,6 +81,8 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
super().tearDown()
|
super().tearDown()
|
||||||
|
Host.objects.all().delete()
|
||||||
|
PublicContact.objects.all().delete()
|
||||||
Domain.objects.all().delete()
|
Domain.objects.all().delete()
|
||||||
DomainInformation.objects.all().delete()
|
DomainInformation.objects.all().delete()
|
||||||
DomainRequest.objects.all().delete()
|
DomainRequest.objects.all().delete()
|
||||||
|
@ -1889,6 +1893,37 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
"Cannot edit a domain request with a restricted creator.",
|
"Cannot edit a domain request with a restricted creator.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@less_console_noise_decorator
|
||||||
|
def test_approved_domain_request_with_ready_domain_has_warning_message(self):
|
||||||
|
"""Tests if the domain request has a warning message when the approved domain is in Ready state"""
|
||||||
|
# Create an instance of the model
|
||||||
|
domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.IN_REVIEW)
|
||||||
|
# Approve the domain request
|
||||||
|
domain_request.approve()
|
||||||
|
domain_request.save()
|
||||||
|
|
||||||
|
# Add nameservers to get to Ready state
|
||||||
|
domain_request.approved_domain.nameservers = [
|
||||||
|
("ns1.city.gov", ["1.1.1.1"]),
|
||||||
|
("ns2.city.gov", ["1.1.1.2"]),
|
||||||
|
]
|
||||||
|
domain_request.approved_domain.save()
|
||||||
|
|
||||||
|
with boto3_mocking.clients.handler_for("sesv2", self.mock_client):
|
||||||
|
with patch("django.contrib.messages.warning") as mock_warning:
|
||||||
|
# Create a request object
|
||||||
|
self.client.force_login(self.superuser)
|
||||||
|
self.client.get(
|
||||||
|
"/admin/registrar/domainrequest/{}/change/".format(domain_request.pk),
|
||||||
|
follow=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
# Assert that the error message was called with the correct argument
|
||||||
|
mock_warning.assert_called_once_with(
|
||||||
|
ANY, # don't care about the request argument
|
||||||
|
f"The status of this domain request cannot be changed because it has been joined to a domain in Ready status: <a href='/admin/registrar/domain/{domain_request.approved_domain.id}/change/'>{domain_request.approved_domain.name}</a>", # noqa
|
||||||
|
)
|
||||||
|
|
||||||
def trigger_saving_approved_to_another_state(self, domain_is_active, another_state, rejection_reason=None):
|
def trigger_saving_approved_to_another_state(self, domain_is_active, another_state, rejection_reason=None):
|
||||||
"""Helper method that triggers domain request state changes from approved to another state,
|
"""Helper method that triggers domain request state changes from approved to another state,
|
||||||
with an associated domain that can be either active (READY) or not.
|
with an associated domain that can be either active (READY) or not.
|
||||||
|
|
|
@ -1,68 +1,68 @@
|
||||||
-i https://pypi.python.org/simple
|
-i https://pypi.python.org/simple
|
||||||
annotated-types==0.7.0; python_version >= '3.8'
|
annotated-types==0.7.0; python_version >= '3.8'
|
||||||
asgiref==3.8.1; python_version >= '3.8'
|
asgiref==3.8.1; python_version >= '3.8'
|
||||||
boto3==1.35.41; python_version >= '3.8'
|
boto3==1.35.91; python_version >= '3.8'
|
||||||
botocore==1.35.41; python_version >= '3.8'
|
botocore==1.35.91; python_version >= '3.8'
|
||||||
cachetools==5.5.0; python_version >= '3.7'
|
cachetools==5.5.0; python_version >= '3.7'
|
||||||
certifi==2024.8.30; python_version >= '3.6'
|
certifi==2024.12.14; python_version >= '3.6'
|
||||||
cfenv==0.5.3
|
cfenv==0.5.3
|
||||||
cffi==1.17.1; platform_python_implementation != 'PyPy'
|
cffi==1.17.1; python_version >= '3.8'
|
||||||
charset-normalizer==3.4.0; python_full_version >= '3.7.0'
|
charset-normalizer==3.4.1; python_version >= '3.7'
|
||||||
cryptography==43.0.1; python_version >= '3.7'
|
cryptography==44.0.0; python_version >= '3.7' and python_full_version not in '3.9.0, 3.9.1'
|
||||||
defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
|
defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
|
||||||
diff-match-patch==20230430; python_version >= '3.7'
|
diff-match-patch==20241021; python_version >= '3.7'
|
||||||
dj-database-url==2.2.0
|
dj-database-url==2.3.0
|
||||||
dj-email-url==1.0.6
|
dj-email-url==1.0.6
|
||||||
django==4.2.17; python_version >= '3.8'
|
django==4.2.17; python_version >= '3.8'
|
||||||
django-admin-multiple-choice-list-filter==0.1.1
|
django-admin-multiple-choice-list-filter==0.1.1
|
||||||
django-allow-cidr==0.7.1
|
django-allow-cidr==0.7.1
|
||||||
django-auditlog==3.0.0; python_version >= '3.8'
|
django-auditlog==3.0.0; python_version >= '3.8'
|
||||||
django-cache-url==3.4.5
|
django-cache-url==3.4.5
|
||||||
django-cors-headers==4.5.0; python_version >= '3.9'
|
django-cors-headers==4.6.0; python_version >= '3.9'
|
||||||
django-csp==3.8
|
django-csp==3.8
|
||||||
django-fsm==2.8.1
|
django-fsm==2.8.1
|
||||||
django-import-export==4.1.1; python_version >= '3.8'
|
django-import-export==4.3.3; python_version >= '3.9'
|
||||||
django-login-required-middleware==0.9.0
|
django-login-required-middleware==0.9.0
|
||||||
django-phonenumber-field[phonenumberslite]==8.0.0; python_version >= '3.8'
|
django-phonenumber-field[phonenumberslite]==8.0.0; python_version >= '3.8'
|
||||||
django-waffle==4.1.0; python_version >= '3.8'
|
django-waffle==4.2.0; python_version >= '3.8'
|
||||||
django-widget-tweaks==1.5.0; python_version >= '3.8'
|
django-widget-tweaks==1.5.0; python_version >= '3.8'
|
||||||
environs[django]==11.0.0; python_version >= '3.8'
|
environs[django]==11.2.1; python_version >= '3.8'
|
||||||
faker==30.3.0; python_version >= '3.8'
|
faker==33.1.0; python_version >= '3.8'
|
||||||
fred-epplib@ git+https://github.com/cisagov/epplib.git@d56d183f1664f34c40ca9716a3a9a345f0ef561c
|
fred-epplib @ git+https://github.com/cisagov/epplib.git@d56d183f1664f34c40ca9716a3a9a345f0ef561c
|
||||||
furl==2.1.3
|
furl==2.1.3
|
||||||
future==1.0.0; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
future==1.0.0; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2'
|
||||||
gevent==24.10.2; python_version >= '3.9'
|
gevent==24.11.1; python_version >= '3.9'
|
||||||
greenlet==3.1.1; python_version >= '3.7'
|
greenlet==3.1.1; python_version >= '3.7'
|
||||||
gunicorn==23.0.0; python_version >= '3.7'
|
gunicorn==23.0.0; python_version >= '3.7'
|
||||||
idna==3.10; python_version >= '3.6'
|
idna==3.10; python_version >= '3.6'
|
||||||
jmespath==1.0.1; python_version >= '3.7'
|
jmespath==1.0.1; python_version >= '3.7'
|
||||||
lxml==5.3.0; python_version >= '3.6'
|
lxml==5.3.0; python_version >= '3.6'
|
||||||
mako==1.3.5; python_version >= '3.8'
|
mako==1.3.8; python_version >= '3.8'
|
||||||
markupsafe==3.0.1; python_version >= '3.9'
|
markupsafe==3.0.2; python_version >= '3.9'
|
||||||
marshmallow==3.22.0; python_version >= '3.8'
|
marshmallow==3.23.2; python_version >= '3.9'
|
||||||
oic==1.7.0; python_version ~= '3.8'
|
oic==1.7.0; python_version ~= '3.8'
|
||||||
orderedmultidict==1.0.1
|
orderedmultidict==1.0.1
|
||||||
packaging==24.1; python_version >= '3.8'
|
packaging==24.2; python_version >= '3.8'
|
||||||
phonenumberslite==8.13.47
|
phonenumberslite==8.13.52
|
||||||
psycopg2-binary==2.9.9; python_version >= '3.7'
|
psycopg2-binary==2.9.10; python_version >= '3.8'
|
||||||
pycparser==2.22; python_version >= '3.8'
|
pycparser==2.22; python_version >= '3.8'
|
||||||
pycryptodomex==3.21.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'
|
pycryptodomex==3.21.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'
|
||||||
pydantic==2.9.2; python_version >= '3.8'
|
pydantic==2.10.4; python_version >= '3.8'
|
||||||
pydantic-core==2.23.4; python_version >= '3.8'
|
pydantic-core==2.27.2; python_version >= '3.8'
|
||||||
pydantic-settings==2.5.2; python_version >= '3.8'
|
pydantic-settings==2.7.1; python_version >= '3.8'
|
||||||
pyjwkest==1.4.2
|
pyjwkest==1.4.2
|
||||||
python-dateutil==2.9.0.post0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
python-dateutil==2.9.0.post0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'
|
||||||
python-dotenv==1.0.1; python_version >= '3.8'
|
python-dotenv==1.0.1; python_version >= '3.8'
|
||||||
pyzipper==0.3.6; python_version >= '3.4'
|
pyzipper==0.3.6; python_version >= '3.4'
|
||||||
requests==2.32.3; python_version >= '3.8'
|
requests==2.32.3; python_version >= '3.8'
|
||||||
s3transfer==0.10.3; python_version >= '3.8'
|
s3transfer==0.10.4; python_version >= '3.8'
|
||||||
setuptools==75.1.0; python_version >= '3.8'
|
setuptools==75.6.0; python_version >= '3.9'
|
||||||
six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
|
six==1.17.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'
|
||||||
sqlparse==0.5.1; python_version >= '3.8'
|
sqlparse==0.5.3; python_version >= '3.8'
|
||||||
tablib[html,ods,xls,xlsx,yaml]==3.5.0; python_version >= '3.8'
|
tablib==3.7.0; python_version >= '3.9'
|
||||||
tblib==3.0.0; python_version >= '3.8'
|
tblib==3.0.0; python_version >= '3.8'
|
||||||
typing-extensions==4.12.2; python_version >= '3.8'
|
typing-extensions==4.12.2; python_version >= '3.8'
|
||||||
urllib3==2.2.3; python_version >= '3.8'
|
urllib3==2.3.0; python_version >= '3.9'
|
||||||
whitenoise==6.7.0; python_version >= '3.8'
|
whitenoise==6.8.2; python_version >= '3.9'
|
||||||
zope.event==5.0; python_version >= '3.7'
|
zope.event==5.0; python_version >= '3.7'
|
||||||
zope.interface==7.1.0; python_version >= '3.8'
|
zope.interface==7.2; python_version >= '3.8'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue