From 4ec3d71324cfa70ad3b8e6cb978efc66a7ac4bcc Mon Sep 17 00:00:00 2001 From: csae8092 Date: Mon, 13 Jan 2025 16:41:21 +0100 Subject: [PATCH] hotfix for #294 --- network/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network/views.py b/network/views.py index 5ea1eb3..387ea96 100644 --- a/network/views.py +++ b/network/views.py @@ -44,10 +44,14 @@ def get_realtions_as_tei(request): + query_limit = 15000 doc = TeiReader(tei_template) root = doc.any_xpath(".//tei:listRelation")[0] query_params = request.GET qs = EdgeListFilter(query_params, queryset=Edge.objects.all()).qs + object_count = qs.count() + if object_count > query_limit: + return HttpResponse(f"{object_count} Treffer. Angezeigt werden können maximal {query_limit} Verbindungen. Bitte grenzen sie die Ergebnisse weiter ein.", status=400) # noqa: E501 for x in qs: relation = ET.SubElement(root, "{http://www.tei-c.org/ns/1.0}relation") relation.attrib["name"] = slugify(x.edge_label)