Skip to content

Commit

Permalink
Fixes page_count computation crash when there is no result
Browse files Browse the repository at this point in the history
  • Loading branch information
biwano committed Oct 11, 2023
1 parent 24f653a commit e936d2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/apps/api/endpoints/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ def wrapper(*func_args, **kwargs):
page_size = items_count

# Compute info
pages_count = math.ceil(items_count / page_size)
if items_count > 0:
pages_count = math.ceil(items_count / page_size)
else:
pages_count = 1

# Slice dataframe
df = df[page_size * page:page_size * (page + 1)]
Expand Down

0 comments on commit e936d2d

Please sign in to comment.