Skip to content

Commit b8c5f7c

Browse files
committed
temporarily disable streaming responses
1 parent e112fa0 commit b8c5f7c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

open_bus_stride_api/common/sql_route.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def list_(sql, sql_params, default_limit, limit, offset, get_count, order_by, sk
3131
sql_order_by = ' order by ' + ', '.join([f'{fieldname} {direction}' for direction, fieldname in order_by_args])
3232
if limit is not None:
3333
sql_limit = f' limit {limit}'
34-
assert sql_limit and 0 < limit <= 1000, "due to abuse, limit must be between 1 and 1000, contact us if you need more"
34+
assert get_count or (sql_limit and 0 < limit <= 1000), "due to abuse, limit must be between 1 and 1000, contact us if you need more"
3535
if offset is not None:
3636
sql_offset = f' offset {offset}'
3737
if sql_order_by or sql_limit or sql_offset:

open_bus_stride_api/routers/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def get_list_query(session, db_model, limit, offset, filters=None, default_limit
168168
limit = default_limit
169169
if limit:
170170
limit = int(limit)
171-
assert 0 < limit <= 1000, "due to abuse, maximum limit per request is 1000 items, contact us if you need more"
171+
assert get_count or (limit and 0 < limit <= 1000), "due to abuse, maximum limit per request is 1000 items, contact us if you need more"
172172
if filters is None:
173173
filters = []
174174
if get_base_session_query_callback is None:

0 commit comments

Comments
 (0)