Fix: Apply tags to findings/endpoints when TRACK_IMPORT_HISTORY is disabled #13969
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #13312
Problem
When
TRACK_IMPORT_HISTORYis disabled, tags were not being applied to findings and endpoints during import because the tag application logic was insideupdate_import_history()which returned early when the setting was disabled.Solution
Refactored the code to:
apply_import_tags()methodapply_import_tags()from importers afterupdate_import_history()update_import_history()This ensures tags are applied regardless of the
TRACK_IMPORT_HISTORYsetting while maintaining separation of concerns and eliminating code duplication.Changes
dojo/importers/base_importer.py: Addedapply_import_tags()method and removed tag logic fromupdate_import_history()dojo/importers/default_importer.py: Added call toapply_import_tags()afterupdate_import_history()dojo/importers/default_reimporter.py: Added call toapply_import_tags()afterupdate_import_history()