Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rachidatecs committed Nov 20, 2024
1 parent 2b3ce1c commit ec8e8b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/registrar/fixtures/fixtures_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def _get_requested_domain(cls, request: DomainRequest, request_dict: dict):
if not request.requested_domain:
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]
# Generate a unique fake domain

# Generate a unique fake domain
return cls.fake_dot_gov()
return request.requested_domain

Expand Down Expand Up @@ -233,19 +233,19 @@ def _get_random_portfolio(cls):
except Exception as e:
logger.warning(f"Expected fixture portfolio, did not find it: {e}")
return None

@classmethod
def _get_random_sub_organization(cls, request):
try:
# Filter Suborganizations by the request's portfolio
portfolio_suborganizations = Suborganization.objects.filter(portfolio=request.portfolio)

# Assuming SuborganizationFixture.SUBORGS is a list of dictionaries with a "name" key
suborganization_names = [suborg["name"] for suborg in SuborganizationFixture.SUBORGS]

# Further filter by names in suborganization_names
suborganization_options = portfolio_suborganizations.filter(name__in=suborganization_names)

# Randomly choose one if any exist
return random.choice(suborganization_options) if suborganization_options.exists() else None # nosec
except Exception as e:
Expand Down
3 changes: 1 addition & 2 deletions src/registrar/fixtures/fixtures_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ class UserFixture:
]

STAFF = [

# {
# "username": "994b7a90-f1d1-4140-a3d2-ff34183c7ee2",
# "first_name": "Rach test staff",
Expand Down Expand Up @@ -344,7 +343,7 @@ def load_users(cls, users, group_name, are_superusers=False):
# Only append the user if any of the fields were updated
if updated:
users_to_update.append(user)

# Save any users that were updated
if users_to_update:
User.objects.bulk_update(users_to_update, ["is_staff"])
Expand Down

0 comments on commit ec8e8b1

Please sign in to comment.