Skip to content

Commit 62d8887

Browse files
make tag accumulator mandatory param
1 parent 7770016 commit 62d8887

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

dojo/importers/default_reimporter.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ def finding_post_processing(
968968
finding_from_report: Finding,
969969
*,
970970
is_matched_finding: bool = False,
971-
tag_accumulator: list | None = None,
971+
tag_accumulator: list,
972972
) -> Finding:
973973
"""
974974
Save all associated objects to the finding after it has been saved
@@ -990,15 +990,10 @@ def finding_post_processing(
990990
finding_from_report.unsaved_tags = merged_tags
991991
if finding_from_report.unsaved_tags:
992992
cleaned_tags = clean_tags(finding_from_report.unsaved_tags)
993-
if tag_accumulator is not None:
994-
if isinstance(cleaned_tags, list):
995-
tag_accumulator.append((finding, cleaned_tags))
996-
elif isinstance(cleaned_tags, str):
997-
tag_accumulator.append((finding, [cleaned_tags]))
998-
elif isinstance(cleaned_tags, list):
999-
finding.tags.add(*cleaned_tags)
993+
if isinstance(cleaned_tags, list):
994+
tag_accumulator.append((finding, cleaned_tags))
1000995
elif isinstance(cleaned_tags, str):
1001-
finding.tags.add(cleaned_tags)
996+
tag_accumulator.append((finding, [cleaned_tags]))
1002997
# Process any files
1003998
if finding_from_report.unsaved_files:
1004999
finding.unsaved_files = finding_from_report.unsaved_files

0 commit comments

Comments
 (0)