Commit 017fb798 authored by axiiom's avatar axiiom
Browse files

issue when accessing children, see TODO on line 250

parent c21f4dda
...@@ -246,6 +246,8 @@ def search_resource(session, model_cls, data): ...@@ -246,6 +246,8 @@ def search_resource(session, model_cls, data):
:param data: A dictionary containing search parameters :param data: A dictionary containing search parameters
:return: a Flask Response object :return: a Flask Response object
''' '''
# TODO: returns 404 when accessing children - i think it should just return an empty array
  • THIS SHOULD READ: "returns 404 when accessing children of an endpoint with no children" i.e: point/2/children returns 404 because point/2 has no children

Please register or sign in to reply
query = session.query(model_cls).filter_by(**data) query = session.query(model_cls).filter_by(**data)
resp = (None, 404) if query.first() is None else \ resp = (None, 404) if query.first() is None else \
(list(map(lambda m: m.as_json(), query.limit(100).all())), 200) (list(map(lambda m: m.as_json(), query.limit(100).all())), 200)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment