Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dojo/importers/default_reimporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,4 +772,6 @@ def calculate_unsaved_finding_hash_code(
self,
unsaved_finding: Finding,
) -> str:
# this is overridden in Pro, but will still call this via super()
deduplicationLogger.debug("Calculating hash code for unsaved finding")
return unsaved_finding.compute_hash_code()
5 changes: 5 additions & 0 deletions dojo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2908,6 +2908,11 @@ def risk_acceptance(self):
return None

def compute_hash_code(self):
# Allow Pro to overwrite compute hash_code which gets dedupe settings from a database instead of django.settings
from dojo.utils import get_custom_method # noqa: PLC0415 circular import
if compute_hash_code_method := get_custom_method("FINDING_COMPUTE_HASH_METHOD"):
deduplicationLogger.debug("using custom compute_hash_code method")
return compute_hash_code_method(self)

# Check if all needed settings are defined
if not hasattr(settings, "HASHCODE_FIELDS_PER_SCANNER") or not hasattr(settings, "HASHCODE_ALLOWS_NULL_CWE") or not hasattr(settings, "HASHCODE_ALLOWED_FIELDS"):
Expand Down