Skip to content

Commit

Permalink
fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
alexviquez committed Jan 20, 2021
1 parent c734634 commit 434f011
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions agave/blueprints/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ def query():
next_page = <url_for_next_items>
}
"""
if hasattr(cls, 'query'):
return cls.query() # pragma: no cover
params = self.current_request.query_params or dict()
try:
query_params = cls.query_validator(**params)
Expand All @@ -199,6 +197,9 @@ def query():
if self.user_id_filter_required():
query_params.user_id = self.current_user_id
filters = cls.get_query_filter(query_params)
if hasattr(cls, 'query'):
items = _all(query_params, filters)
return cls.query(items) # pragma: no cover
if query_params.count:
return _count(filters)
return _all(query_params, filters)
Expand Down

0 comments on commit 434f011

Please sign in to comment.