Skip to content

Commit

Permalink
fix ruff for version 0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-sommer committed Jan 23, 2025
1 parent 8cce31d commit ea650fe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions dojo/management/commands/import_surveys.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def handle(self, *args, **options):
new_line = matchedLine.replace(old_id, str(ctype_id))
# Replace the all lines in the file
with open(path, "w", encoding="utf-8") as fout:
for line in contents:
fout.write(line.replace(matchedLine, new_line))
fout.writelines(line.replace(matchedLine, new_line) for line in contents)
# Delete the temp question
created_question.delete()
2 changes: 0 additions & 2 deletions dojo/tools/mobsf/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ def get_findings(self, filename, test):
"file_path": None,
}
mobsf_findings.append(mobsf_item)
else:
pass

# Manifest Analysis
if "manifest_analysis" in data:
Expand Down
6 changes: 2 additions & 4 deletions dojo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1379,8 +1379,7 @@ def handle_uploaded_threat(f, eng):
Path(settings.MEDIA_ROOT + "/threat/").mkdir()
with open(settings.MEDIA_ROOT + f"/threat/{eng.id}{extension}",
"wb+") as destination:
for chunk in f.chunks():
destination.write(chunk)
destination.writelines(chunk for chunk in f.chunks())
eng.tmodel_path = settings.MEDIA_ROOT + f"/threat/{eng.id}{extension}"
eng.save()

Expand All @@ -1390,8 +1389,7 @@ def handle_uploaded_selenium(f, cred):
extension = path.suffix
with open(settings.MEDIA_ROOT + f"/selenium/{cred.id}{extension}",
"wb+") as destination:
for chunk in f.chunks():
destination.write(chunk)
destination.writelines(chunk for chunk in f.chunks())
cred.selenium_script = settings.MEDIA_ROOT + f"/selenium/{cred.id}{extension}"
cred.save()

Expand Down

0 comments on commit ea650fe

Please sign in to comment.