Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that page is a positive integer (Fixes #344) #401

Merged
merged 5 commits into from
Feb 27, 2013

Conversation

nigelbabu
Copy link
Contributor

No description provided.

@nigelbabu
Copy link
Contributor Author

It isn't obvious to me where I would write a test for this. Can someone give a pointer?

@seanh
Copy link
Contributor

seanh commented Feb 15, 2013

@nigelbabu Since this bug fix is in a controller, it'd be a frontend test that you would have to write. Frontend tests are in ckan/tests/functional/. Grepping that dir, I can see some feed controller tests in ckan/tests/functional/test_package.py. Maybe that would be the right place to add? It looks like the feed controller is also tested in group.py.

@@ -282,7 +282,9 @@ def custom(self):
try:
page = int(request.params.get('page', 1))
except ValueError:
abort(400, ('"page" parameter must be an integer'))
abort(400, ('"page" parameter must be a positive integer'))
Copy link
Contributor

Choose a reason for hiding this comment

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

should the error be translatable?
abort(400, _('"page" parameter must be a positive integer'))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None of the errors in feed.py seem translated. Do you want me to tackle that in this pull request or move it to a different one?

Copy link
Contributor

Choose a reason for hiding this comment

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

The only existing one I see is 'group not found' you may as well fix that here

@ghost ghost assigned domoritz Feb 26, 2013
@domoritz
Copy link
Contributor

I'll merge this for now but might change the validation in #473.

domoritz added a commit that referenced this pull request Feb 27, 2013
Check that page is a positive integer (Fixes #344)
@domoritz domoritz merged commit a2ecef4 into master Feb 27, 2013
@smotornyuk smotornyuk deleted the 344-page-param-positive-check branch December 19, 2018 15:21
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.

None yet

4 participants