Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading