From 12235cc85346373909763b75c80ec3b6a13656f9 Mon Sep 17 00:00:00 2001 From: jonaswinkler <17569239+jonaswinkler@users.noreply.github.com> Date: Wed, 3 Mar 2021 23:35:26 +0100 Subject: [PATCH] fixes #689 --- src/documents/classifier.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/documents/classifier.py b/src/documents/classifier.py index 47dd7dfc7..664c00222 100755 --- a/src/documents/classifier.py +++ b/src/documents/classifier.py @@ -123,10 +123,11 @@ class DocumentClassifier(object): m.update(y.to_bytes(4, 'little', signed=True)) labels_correspondent.append(y) - tags = [tag.pk for tag in doc.tags.filter( + tags = sorted([tag.pk for tag in doc.tags.filter( matching_algorithm=MatchingModel.MATCH_AUTO - )] - m.update(bytearray(tags)) + )]) + for tag in tags: + m.update(tag.to_bytes(4, 'little', signed=True)) labels_tags.append(tags) if not data: