Skip to content

Commit

Permalink
fix error in areas query (no limit was used)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Dec 18, 2023
1 parent 8de09f3 commit b9e9dee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/ref_geo/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ def get_areas():

limit = int(params.get("limit")[0]) if params.get("limit") else 100

data = db.session.scalars(query.limit(limit)).unique().all()

# allow to format response
format = request.args.get("format", default="", type=str)

Expand All @@ -239,7 +237,7 @@ def get_areas():
fields |= {"+geojson_4326"}
query = query.options(undefer("geojson_4326"))

data = db.session.scalars(query).unique().all()
data = db.session.scalars(query.limit(limit)).unique().all()
response = [d.as_dict(fields=fields) for d in data]
if format == "geojson":
# format features as geojson according to standard
Expand Down

0 comments on commit b9e9dee

Please sign in to comment.