From 038d924c7ec47c94a2da10bc3fffe4927f6d4fd4 Mon Sep 17 00:00:00 2001 From: Bernhard Koschicek-Krombholz Date: Mon, 9 Dec 2024 17:03:22 +0100 Subject: [PATCH] small changes --- openatlas/api/endpoints/endpoint.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/openatlas/api/endpoints/endpoint.py b/openatlas/api/endpoints/endpoint.py index 3d2bf9dd8..41764fb29 100644 --- a/openatlas/api/endpoints/endpoint.py +++ b/openatlas/api/endpoints/endpoint.py @@ -17,8 +17,7 @@ from openatlas.api.resources.resolve_endpoints import ( download, parse_loud_context) from openatlas.api.resources.templates import ( - geojson_collection_template, linked_places_template, loud_template, - ) + geojson_collection_template, linked_places_template, loud_template) from openatlas.api.resources.util import ( get_linked_entities_api, get_location_link, remove_duplicate_entities) from openatlas.models.entity import Entity, Link @@ -70,14 +69,12 @@ def resolve_entities(self) -> Response | dict[str, Any]: if self.parser.search: self.entities = [ e for e in self.entities if self.parser.search_filter(e)] - self.remove_duplicate_entities() + if self.parser.count == 'true': + return jsonify(len(self.entities)) self.sort_entities() self.get_pagination() - if self.parser.count == 'true': - return jsonify(self.pagination['count']) self.reduce_entities_list() - if self.parser.export == 'csv': return self.export_entities_csv() if self.parser.export == 'csvNetwork': @@ -93,7 +90,6 @@ def resolve_entities(self) -> Response | dict[str, Any]: return Response( self.parser.rdf_output(result['results']), mimetype=app.config['RDF_FORMATS'][self.parser.format]) - if self.parser.download == 'true': return download(result, self.parser.get_entities_template()) return marshal(result, self.parser.get_entities_template())