Skip to content

Commit

Permalink
fix(api): using count without start results in pagination not working
Browse files Browse the repository at this point in the history
  • Loading branch information
omame committed Dec 17, 2022
1 parent 7f2cd9c commit 000274c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bob/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Constants used by bob.
"""
__version__ = "2.7.3"
__version__ = "2.7.4"

import random

Expand Down
2 changes: 1 addition & 1 deletion cogs/webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def question_list():
questions = {i: q for i, q in questions.items() for r in q["responses"] if response_search in r["text"]}
start = int(start) if start else None
count = int(count) if count else None
end = start + count if start is not None and count is not None else None
end = start + count if start is not None and count is not None else count
questions = {i: q for i, q in list(questions.items())[start:end]}
return questions

Expand Down

0 comments on commit 000274c

Please sign in to comment.