Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardKoschicek committed Dec 9, 2024
1 parent 5fbaea1 commit 038d924
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions openatlas/api/endpoints/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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':
Expand All @@ -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())
Expand Down

0 comments on commit 038d924

Please sign in to comment.