mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 10:46:06 +02:00
lint
This commit is contained in:
parent
2b3ce1cdfb
commit
ec8e8b1f65
2 changed files with 6 additions and 7 deletions
|
@ -194,8 +194,8 @@ class DomainRequestFixture:
|
||||||
if not request.requested_domain:
|
if not request.requested_domain:
|
||||||
if "requested_domain" in request_dict and request_dict["requested_domain"] is not None:
|
if "requested_domain" in request_dict and request_dict["requested_domain"] is not None:
|
||||||
return DraftDomain.objects.get_or_create(name=request_dict["requested_domain"])[0]
|
return DraftDomain.objects.get_or_create(name=request_dict["requested_domain"])[0]
|
||||||
|
|
||||||
# Generate a unique fake domain
|
# Generate a unique fake domain
|
||||||
return cls.fake_dot_gov()
|
return cls.fake_dot_gov()
|
||||||
return request.requested_domain
|
return request.requested_domain
|
||||||
|
|
||||||
|
@ -233,19 +233,19 @@ class DomainRequestFixture:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"Expected fixture portfolio, did not find it: {e}")
|
logger.warning(f"Expected fixture portfolio, did not find it: {e}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_random_sub_organization(cls, request):
|
def _get_random_sub_organization(cls, request):
|
||||||
try:
|
try:
|
||||||
# Filter Suborganizations by the request's portfolio
|
# Filter Suborganizations by the request's portfolio
|
||||||
portfolio_suborganizations = Suborganization.objects.filter(portfolio=request.portfolio)
|
portfolio_suborganizations = Suborganization.objects.filter(portfolio=request.portfolio)
|
||||||
|
|
||||||
# Assuming SuborganizationFixture.SUBORGS is a list of dictionaries with a "name" key
|
# Assuming SuborganizationFixture.SUBORGS is a list of dictionaries with a "name" key
|
||||||
suborganization_names = [suborg["name"] for suborg in SuborganizationFixture.SUBORGS]
|
suborganization_names = [suborg["name"] for suborg in SuborganizationFixture.SUBORGS]
|
||||||
|
|
||||||
# Further filter by names in suborganization_names
|
# Further filter by names in suborganization_names
|
||||||
suborganization_options = portfolio_suborganizations.filter(name__in=suborganization_names)
|
suborganization_options = portfolio_suborganizations.filter(name__in=suborganization_names)
|
||||||
|
|
||||||
# Randomly choose one if any exist
|
# Randomly choose one if any exist
|
||||||
return random.choice(suborganization_options) if suborganization_options.exists() else None # nosec
|
return random.choice(suborganization_options) if suborganization_options.exists() else None # nosec
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -161,7 +161,6 @@ class UserFixture:
|
||||||
]
|
]
|
||||||
|
|
||||||
STAFF = [
|
STAFF = [
|
||||||
|
|
||||||
# {
|
# {
|
||||||
# "username": "994b7a90-f1d1-4140-a3d2-ff34183c7ee2",
|
# "username": "994b7a90-f1d1-4140-a3d2-ff34183c7ee2",
|
||||||
# "first_name": "Rach test staff",
|
# "first_name": "Rach test staff",
|
||||||
|
@ -344,7 +343,7 @@ class UserFixture:
|
||||||
# Only append the user if any of the fields were updated
|
# Only append the user if any of the fields were updated
|
||||||
if updated:
|
if updated:
|
||||||
users_to_update.append(user)
|
users_to_update.append(user)
|
||||||
|
|
||||||
# Save any users that were updated
|
# Save any users that were updated
|
||||||
if users_to_update:
|
if users_to_update:
|
||||||
User.objects.bulk_update(users_to_update, ["is_staff"])
|
User.objects.bulk_update(users_to_update, ["is_staff"])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue