From 39bcace030ace1e4987c825fc433562734b52b66 Mon Sep 17 00:00:00 2001 From: susanodd Date: Thu, 4 Jul 2024 14:09:01 +0200 Subject: [PATCH] #1268: Open text field panel to start Fixed typo and retrieval error in annotation constraint checking. --- signbank/dictionary/batch_edit.py | 6 +++--- .../templates/dictionary/admin_batch_edit_view.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/signbank/dictionary/batch_edit.py b/signbank/dictionary/batch_edit.py index 7f0f2173..a25ff93e 100644 --- a/signbank/dictionary/batch_edit.py +++ b/signbank/dictionary/batch_edit.py @@ -207,7 +207,7 @@ def check_constraints_on_gloss_language_fields(gloss, value_dict): annotationidglosstranslations = {} for language in dataset.translation_languages.all(): - annotation_key = 'annotation__' + gloss_prefix + language.language_code_2char + annotation_key = 'annotation_' + gloss_prefix + language.language_code_2char if annotation_key in value_dict.keys(): if not value_dict[annotation_key]: e2 = gettext("Annotation field is empty.") @@ -246,8 +246,8 @@ def check_constraints_on_gloss_language_fields(gloss, value_dict): for language, annotations in annotations_per_language_translation.items(): if annotations.count(): this_annotation = annotations.first() - if this_annotation.id not in existing_glosses and this_annotation.id != gloss.id: - existing_glosses.append(this_annotation.id) + if this_annotation.gloss.id not in existing_glosses and this_annotation.gloss.id != gloss.id: + existing_glosses.append(this_annotation.gloss.id) e7 = gettext('Annotation ID Gloss') + " (" + language.name + ') ' + gettext( 'already exists.') errors.append(e7) diff --git a/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html b/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html index c79bfe85..09dc2794 100644 --- a/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html +++ b/signbank/dictionary/templates/dictionary/admin_batch_edit_view.html @@ -512,7 +512,7 @@

{% trans "Batch Edit" %}

{% trans "Text Fields" %}
-
+