Skip to content

Commit

Permalink
hotfix for #294
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Jan 13, 2025
1 parent 7253138 commit 4ec3d71
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions network/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4ec3d71

Please sign in to comment.