Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions slack/web/slack_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ def __next__(self):
if self._iteration == 1:
return self
if self._next_cursor_is_present(self.data):
self.req_args.get("params", {}).update(
{"cursor": self.data["response_metadata"]["next_cursor"]}
)
params = self.req_args.get("params", {})
if params is None:
params = {}
params.update({"cursor": self.data["response_metadata"]["next_cursor"]})
self.req_args.update({"params": params})

if self._use_sync_aiohttp:
# We no longer recommend going with this way
Expand Down
7 changes: 7 additions & 0 deletions tests/web/test_web_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,10 @@ async def test_issue_690_oauth_access_async(self):
self.assertIsNone(resp["error"])
with self.assertRaises(err.SlackApiError):
await self.async_client.oauth_access(client_id="999.999", client_secret="secret", code="codeeeeeeeeee")

def test_issue_705_no_param_request_pagination(self):
self.client.token = "xoxb-users_list_pagination"
users = []
for page in self.client.users_list():
users = users + page["members"]
self.assertTrue(len(users) == 4)