From f76e9a1d8bef0fbdcbeaa95c5f5408ab4184e3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Cl=C3=A9rice?= Date: Tue, 3 Sep 2024 19:46:36 +0200 Subject: [PATCH] Fix a condition on lemma --- app/models/corpus.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/corpus.py b/app/models/corpus.py index e20e7c9..b770497 100644 --- a/app/models/corpus.py +++ b/app/models/corpus.py @@ -1117,7 +1117,11 @@ def is_valid(lemma, POS, morph, corpus): "morph": True } allowed_column = corpus.displayed_columns_by_name - if lemma and "lemma" in allowed_column and allowed_lemma.count()>=0: + if (lemma # If we changed the lemma + and "lemma" in allowed_column # And if the lemma is a column known to the project + and allowed_lemma.count() # And if we have a list of accepted lemma, + ): + # then we check for lemma validity current_controlList = corpus.control_lists regex_liste = [] if current_controlList: