Skip to content

Commit

Permalink
Merge pull request #124 from arthur-schnitzler/main
Browse files Browse the repository at this point in the history
hotfix for #294
  • Loading branch information
csae8092 authored Jan 13, 2025
2 parents 7253138 + 4ec3d71 commit 2e644fd
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 2e644fd

Please sign in to comment.