Skip to content

Commit 4121253

Browse files
author
Valentijn Scholten
committed
attempt 2
1 parent e3f7546 commit 4121253

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

dojo/importers/default_reimporter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,4 +775,5 @@ def calculate_unsaved_finding_hash_code(
775775
self,
776776
unsaved_finding: Finding,
777777
) -> str:
778-
return unsaved_finding.set_hash_code(True)
778+
# this is overridden in Pro, but will still call this via super()
779+
return unsaved_finding.compute_hash_code()

dojo/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,6 +2913,10 @@ def risk_acceptance(self):
29132913
return None
29142914

29152915
def compute_hash_code(self):
2916+
# Allow Pro to overwrite compute hash_code which gets dedupe settings from a database instead of django.settings
2917+
from dojo.utils import get_custom_method # noqa: PLC0415 circular import
2918+
if compute_hash_code_method := get_custom_method("FINDING_COMPUTE_HASH_METHOD"):
2919+
compute_hash_code_method(self)
29162920

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

0 commit comments

Comments
 (0)