From 455255820198b603d508602910bb03af024d0a74 Mon Sep 17 00:00:00 2001 From: Alexander Watzinger Date: Fri, 27 Dec 2024 16:26:40 +0100 Subject: [PATCH] Text annotation: select SQL now filters empty, unconnected annotations --- openatlas/database/annotation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openatlas/database/annotation.py b/openatlas/database/annotation.py index c9a344eca..08ebd01de 100644 --- a/openatlas/database/annotation.py +++ b/openatlas/database/annotation.py @@ -47,6 +47,7 @@ def get_annotation_text_by_source(source_id: int) -> list[dict[str, Any]]: ANNOTATION_TEXT_SELECT + """ WHERE source_id = %(source_id)s + AND NOT (entity_id IS NULL AND (text IS NULL OR text = '')) ORDER BY link_start; """, {'source_id': source_id})