diff --git a/scanpipe/forms.py b/scanpipe/forms.py index d8c539258..0d7c543ba 100644 --- a/scanpipe/forms.py +++ b/scanpipe/forms.py @@ -281,7 +281,7 @@ class ProjectReportForm(forms.Form): ("codebaseresource", "Resources"), ("codebaserelation", "Relations"), ("projectmessage", "Messages"), - ("todos", "TODOs"), + ("todo", "TODOs"), ], required=True, initial="discoveredpackage", diff --git a/scanpipe/pipes/output.py b/scanpipe/pipes/output.py index 3eb07d721..ad09cf3b8 100644 --- a/scanpipe/pipes/output.py +++ b/scanpipe/pipes/output.py @@ -96,7 +96,7 @@ def get_queryset(project, model_name): CodebaseRelation.objects.select_related("from_resource", "to_resource") ), "projectmessage": ProjectMessage.objects.all(), - "todos": CodebaseResource.objects.files().status(flag.REQUIRES_REVIEW), + "todo": CodebaseResource.objects.files().status(flag.REQUIRES_REVIEW), } queryset = querysets.get(model_name) @@ -309,7 +309,7 @@ def to_json(project): "codebaseresource": "resource", "codebaserelation": "relation", "projectmessage": "message", - "todos": "todo", + "todo": "todo", } object_type_to_model_name = { @@ -577,7 +577,7 @@ def add_vulnerabilities_sheet(workbook, project): def add_todos_sheet(workbook, project, exclude_fields): - todos_queryset = get_queryset(project, "todos") + todos_queryset = get_queryset(project, "todo") if todos_queryset: queryset_to_xlsx_worksheet( todos_queryset, workbook, exclude_fields, worksheet_name="TODOS" diff --git a/scanpipe/tests/test_views.py b/scanpipe/tests/test_views.py index 79758f03e..a6f47a24b 100644 --- a/scanpipe/tests/test_views.py +++ b/scanpipe/tests/test_views.py @@ -197,7 +197,7 @@ def test_scanpipe_views_project_action_report_view(self): data = { "action": "report", "selected_ids": f"{self.project1.uuid}", - "model_name": "todos", + "model_name": "todo", } response = self.client.post(url, data=data, follow=True) self.assertEqual("report.xlsx", response.filename) diff --git a/scanpipe/views.py b/scanpipe/views.py index 9257daba5..e47dfd919 100644 --- a/scanpipe/views.py +++ b/scanpipe/views.py @@ -1245,7 +1245,7 @@ def get_export_xlsx_prepend_fields(self): return ["project"] def get_export_xlsx_worksheet_name(self): - if self.report_form.cleaned_data.get("model_name") == "todos": + if self.report_form.cleaned_data.get("model_name") == "todo": return "TODOS" def get_export_xlsx_filename(self):