diff --git a/src/documents/classifier.py b/src/documents/classifier.py index 2971e4ed8..b3e71711c 100644 --- a/src/documents/classifier.py +++ b/src/documents/classifier.py @@ -219,22 +219,11 @@ class DocumentClassifier: labels_tags_unique = {tag for tags in labels_tags for tag in tags} num_tags = len(labels_tags_unique) - latest_doc_change = docs_queryset.latest("modified").modified - - logger.debug( - f"""Found: - Last training: {self.last_doc_change_time} - Latest doc change: {latest_doc_change} - Last auto type hash: {self.last_auto_type_hash.hex() if self.last_auto_type_hash else None} - Current hash: {hasher.digest().hex()} - Result: Retraining required - """, - ) # Check if retraining is actually required. # A document has been updated since the classifier was trained # New auto tags, types, correspondent, storage paths exist - + latest_doc_change = docs_queryset.latest("modified").modified if ( self.last_doc_change_time is not None and self.last_doc_change_time >= latest_doc_change