From 6d79d2de8a6e6130743a577c3e997e6d422b16c9 Mon Sep 17 00:00:00 2001 From: Valentijn Scholten Date: Tue, 11 Nov 2025 18:18:52 +0100 Subject: [PATCH] log a line when custom hash method is used --- dojo/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dojo/models.py b/dojo/models.py index aadd28bbc6f..201b1619ffe 100644 --- a/dojo/models.py +++ b/dojo/models.py @@ -3485,15 +3485,16 @@ def violates_sla(self): def set_hash_code(self, dedupe_option): from dojo.utils import get_custom_method # noqa: PLC0415 circular import if hash_method := get_custom_method("FINDING_HASH_METHOD"): + deduplicationLogger.debug("Using custom hash method") hash_method(self, dedupe_option) # Finding.save is called once from serializers.py with dedupe_option=False because the finding is not ready yet, for example the endpoints are not built # It is then called a second time with dedupe_option defaulted to true; now we can compute the hash_code and run the deduplication elif dedupe_option: if self.hash_code is not None: - deduplicationLogger.debug("Hash_code already computed for finding") + deduplicationLogger.debug("Hash_code already computed for finding %i", self.id) else: self.hash_code = self.compute_hash_code() - deduplicationLogger.debug("Hash_code computed for finding: %s", self.hash_code) + deduplicationLogger.debug("Hash_code computed for finding %i: %s", self.id, self.hash_code) class FindingAdmin(admin.ModelAdmin):