From 11171d86368af23503556cdd3fdb5ef5a2fc07ee Mon Sep 17 00:00:00 2001 From: Cody Maffucci <46459665+Maffooch@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:08:44 -0500 Subject: [PATCH] Fixing ruff --- dojo/finding/views.py | 2 +- dojo/importers/default_importer.py | 2 +- dojo/importers/default_reimporter.py | 2 +- dojo/models.py | 2 +- dojo/notes/helper.py | 2 +- dojo/utils.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dojo/finding/views.py b/dojo/finding/views.py index 95b8760ab36..f40cc11ff84 100644 --- a/dojo/finding/views.py +++ b/dojo/finding/views.py @@ -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")}, ) diff --git a/dojo/importers/default_importer.py b/dojo/importers/default_importer.py index 4eefc5c5bc2..92a63ec025f 100644 --- a/dojo/importers/default_importer.py +++ b/dojo/importers/default_importer.py @@ -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) diff --git a/dojo/importers/default_reimporter.py b/dojo/importers/default_reimporter.py index d3ffc82492c..cdbe6a0671c 100644 --- a/dojo/importers/default_reimporter.py +++ b/dojo/importers/default_reimporter.py @@ -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) diff --git a/dojo/models.py b/dojo/models.py index 0141cc33137..87fd37de497 100644 --- a/dojo/models.py +++ b/dojo/models.py @@ -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, diff --git a/dojo/notes/helper.py b/dojo/notes/helper.py index f4153818387..80f6f80a2a8 100644 --- a/dojo/notes/helper.py +++ b/dojo/notes/helper.py @@ -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}") diff --git a/dojo/utils.py b/dojo/utils.py index 7a421ef90ee..4a3bf96736d 100644 --- a/dojo/utils.py +++ b/dojo/utils.py @@ -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(