Skip to content

Commit

Permalink
Silence Bandit warning
Browse files Browse the repository at this point in the history
  • Loading branch information
DMalone87 committed Oct 20, 2024
1 parent e6927d2 commit b8381ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scrapers/fifty_a/fifty_a/spiders/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def parse(self, response):
commands = response.css("a.command::attr(href)").getall()
logging.info(f"Found {len(commands)} units.")
if self.test_mode and commands:
random.shuffle(commands)
random.shuffle(commands) # nosec
commands = commands[: self.max_units]
for command in commands:
yield response.follow(command, self.parse_command)
Expand Down
4 changes: 2 additions & 2 deletions scrapers/fifty_a/fifty_a/spiders/officer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, *args, **kwargs):
def parse_start_url(self, response):
commands = response.css("a.command::attr(href)").getall()
if self.test_mode and commands:
selected_command = random.choice(commands)
selected_command = random.choice(commands) # nosec
yield response.follow(selected_command, self.parse_command)
elif not self.test_mode:
for command in commands:
Expand All @@ -47,7 +47,7 @@ def parse_command(self, response):
logging.info(f"Found {len(officer_links)} officers in {response.url}")

if self.test_mode:
random.shuffle(officer_links)
random.shuffle(officer_links) # nosec
officer_links = officer_links[: self.max_officers]

for officer_link in officer_links:
Expand Down

0 comments on commit b8381ca

Please sign in to comment.