Skip to content

Commit

Permalink
Fixing ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Maffooch committed Jul 29, 2024
1 parent 322f4b5 commit 11171d8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dojo/finding/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,7 @@ def request_finding_review(request, fid):
return render(
request,
"dojo/review_finding.html",
{"finding": finding, "product_tab": product_tab, "user": user, "form": form, "enable_table_filtering": get_system_setting("enable_ui_table_based_searching"), },
{"finding": finding, "product_tab": product_tab, "user": user, "form": form, "enable_table_filtering": get_system_setting("enable_ui_table_based_searching")},
)


Expand Down
2 changes: 1 addition & 1 deletion dojo/importers/default_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def parse_findings(
# Attempt any preprocessing before generating findings
if len(self.parsed_findings) == 0 and self.test is None:
scan = self.process_scan_file(scan)
if hasattr(parser, 'get_tests'):
if hasattr(parser, "get_tests"):
self.parsed_findings = self.parse_findings_dynamic_test_type(scan, parser)
else:
self.parsed_findings = self.parse_findings_static_test_type(scan, parser)
Expand Down
2 changes: 1 addition & 1 deletion dojo/importers/default_reimporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def parse_findings(
# Attempt any preprocessing before generating findings
if len(self.parsed_findings) == 0 or self.test is None:
scan = self.process_scan_file(scan)
if hasattr(parser, 'get_tests'):
if hasattr(parser, "get_tests"):
self.parsed_findings = self.parse_findings_dynamic_test_type(scan, parser)
else:
self.parsed_findings = self.parse_findings_static_test_type(scan, parser)
Expand Down
2 changes: 1 addition & 1 deletion dojo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ class System_Settings(models.Model):
enable_ui_table_based_searching = models.BooleanField(
default=True,
blank=False,
verbose_name=_('Enable UI Table Based Filtering/Sorting'),
verbose_name=_("Enable UI Table Based Filtering/Sorting"),
help_text=_("With this setting enabled, table headings will contain sort buttons for the current page of data in addition to sorting buttons that consider data from all pages."))
enable_calendar = models.BooleanField(
default=True,
Expand Down
2 changes: 1 addition & 1 deletion dojo/notes/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def delete_related_notes(obj):
if not hasattr(obj, 'notes'):
if not hasattr(obj, "notes"):
logger.warning(f"Attempted to delete notes from object type {type(obj)} without 'notes' attribute.")
return
logging.debug(f"Deleting {obj.notes.count()} notes for {type(obj).__name__} {obj.id}")
Expand Down
2 changes: 1 addition & 1 deletion dojo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2597,7 +2597,7 @@ def generate_file_response(file_object: FileUpload) -> FileResponse:
msg = f"FileUpload object expected but type <{type(file_object)}> received."
raise TypeError(msg)
# Determine the path of the file on disk within the MEDIA_ROOT
file_path = f'{settings.MEDIA_ROOT}/{file_object.file.url.lstrip(settings.MEDIA_URL)}'
file_path = f"{settings.MEDIA_ROOT}/{file_object.file.url.lstrip(settings.MEDIA_URL)}"
_, file_extension = os.path.splitext(file_path)
# Generate the FileResponse
response = FileResponse(
Expand Down

0 comments on commit 11171d8

Please sign in to comment.