Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Limit result_range_max
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Jan 10, 2024
1 parent 56dc9d8 commit d388c4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/schemas/api_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def get_result_range_min(self):
return (self.results_per_page * (self.page - 1)) + 1

def get_result_range_max(self):
return self.results_per_page * self.page
page_max = self.results_per_page * self.page
return page_max if page_max <= self.count else self.count

def page_in_range(self):
return self.page > 0 and self.page <= self.get_pages()
Expand Down

0 comments on commit d388c4d

Please # to comment.