mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-27 04:58:42 +02:00
lint and fix test
This commit is contained in:
parent
8504eb1f39
commit
ad79557a55
5 changed files with 23 additions and 32 deletions
|
@ -244,7 +244,6 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
is called in the validate function on the request/domain page
|
||||
|
||||
throws- RegistryError or InvalidDomainError"""
|
||||
return True
|
||||
if not cls.string_could_be_domain(domain):
|
||||
logger.warning("Not a valid domain: %s" % str(domain))
|
||||
# throw invalid domain error so that it can be caught in
|
||||
|
|
|
@ -1293,9 +1293,13 @@ class DomainRequest(TimeStampedModel):
|
|||
if flag_is_active_anywhere("organization_feature") and flag_is_active_anywhere("organization_requests"):
|
||||
# Check if the current federal agency is an outlawed one
|
||||
Portfolio = apps.get_model("registrar.Portfolio")
|
||||
return FederalAgency.objects.exclude(
|
||||
return (
|
||||
FederalAgency.objects.exclude(
|
||||
agency__in=Portfolio.objects.values_list("organization_name", flat=True),
|
||||
).filter(agency=self.federal_agency).exists()
|
||||
)
|
||||
.filter(agency=self.federal_agency)
|
||||
.exists()
|
||||
)
|
||||
|
||||
# NOTE: Shouldn't this be an AND on all required fields?
|
||||
return (
|
||||
|
|
|
@ -3230,16 +3230,10 @@ class TestDomainRequestWizard(TestWithUser, WebTest):
|
|||
federal_agency = FederalAgency.objects.create(agency="Portfolio Agency")
|
||||
|
||||
# Create a portfolio with matching organization name
|
||||
Portfolio.objects.create(
|
||||
creator=self.user,
|
||||
organization_name=federal_agency.agency
|
||||
)
|
||||
Portfolio.objects.create(creator=self.user, organization_name=federal_agency.agency)
|
||||
|
||||
# Create domain request with the portfolio agency
|
||||
domain_request = completed_domain_request(
|
||||
federal_agency=federal_agency,
|
||||
user=self.user
|
||||
)
|
||||
domain_request = completed_domain_request(federal_agency=federal_agency, user=self.user)
|
||||
self.assertFalse(domain_request.unlock_organization_contact())
|
||||
|
||||
@override_flag("organization_feature", active=False)
|
||||
|
@ -3251,15 +3245,9 @@ class TestDomainRequestWizard(TestWithUser, WebTest):
|
|||
federal_agency = FederalAgency.objects.create(agency="Portfolio Agency")
|
||||
|
||||
# Create a portfolio with matching organization name
|
||||
Portfolio.objects.create(
|
||||
creator=self.user,
|
||||
organization_name=federal_agency.agency
|
||||
)
|
||||
Portfolio.objects.create(creator=self.user, organization_name=federal_agency.agency)
|
||||
|
||||
domain_request = completed_domain_request(
|
||||
federal_agency=federal_agency,
|
||||
user=self.user
|
||||
)
|
||||
domain_request = completed_domain_request(federal_agency=federal_agency, user=self.user)
|
||||
self.assertTrue(domain_request.unlock_organization_contact())
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue