Skip to content

Conversation

@cawal
Copy link
Contributor

@cawal cawal commented Aug 9, 2021

When a user pass the p parameter in query,
Django returns a string. The string needs to be
casted to integer in order to be used in the paginator.
Otherwise, the response returns BadRequest.

@HRezaei
Copy link

HRezaei commented Oct 22, 2021

Good job @cawal!
I need this bug fix. 😊
@toastdriven and other contributors: would you please accept this PR?

restless/dj.py Outdated
paginator = Paginator(data, page_size)

page_number = self.request.GET.get('p', 1)
page_number = int(self.request.GET.get('p', 1))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to treat the error in case the cast is not possible.

@seocam
Copy link
Collaborator

seocam commented Dec 23, 2021

We need to rebase and to get tests running. I'm not sure why the tests are not running.

When a user pass the `p` parameter in query,
Django returns a string. The string needs to be
casted to integer in order to be used in the paginator.
Otherwise, the response returns BadRequest.
@cawal
Copy link
Contributor Author

cawal commented Dec 24, 2021

Rebased. =]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants