Skip to content

Commit 19dc283

Browse files
valentijnscholtenValentijn Scholten
andauthored
log a line when custom hash method is used (#13679)
Co-authored-by: Valentijn Scholten <valentijn.scholten@iodigital.com>
1 parent bea1002 commit 19dc283

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dojo/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3494,15 +3494,16 @@ def violates_sla(self):
34943494
def set_hash_code(self, dedupe_option):
34953495
from dojo.utils import get_custom_method # noqa: PLC0415 circular import
34963496
if hash_method := get_custom_method("FINDING_HASH_METHOD"):
3497+
deduplicationLogger.debug("Using custom hash method")
34973498
hash_method(self, dedupe_option)
34983499
# 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
34993500
# It is then called a second time with dedupe_option defaulted to true; now we can compute the hash_code and run the deduplication
35003501
elif dedupe_option:
35013502
if self.hash_code is not None:
3502-
deduplicationLogger.debug("Hash_code already computed for finding")
3503+
deduplicationLogger.debug("Hash_code already computed for finding %i", self.id)
35033504
else:
35043505
self.hash_code = self.compute_hash_code()
3505-
deduplicationLogger.debug("Hash_code computed for finding: %s", self.hash_code)
3506+
deduplicationLogger.debug("Hash_code computed for finding %i: %s", self.id, self.hash_code)
35063507

35073508

35083509
class FindingAdmin(admin.ModelAdmin):

0 commit comments

Comments
 (0)