Description
Topic of discussion
The page range option on the Ion printing page does not clearly describe the possible ways to represent the range.
For example, it might be intuitive for some people that to get the first 3 pages the page range might be 0-3
, but pages
aren't zero indexed. Furthuremore, Ion only gives the vague error message of an invalid page range, which doesn't tell the user if it was a parsing issue, or an out of bounds issue, or something else.
Proposed options/solutions
Rewrite check_page_range
ion/intranet/apps/printing/views.py
Line 244 in 8cb7791
to return more descriptive errors (instead of returning
None
), and maybe add a help_text
for the page range option.
Whatever behavior is added/changed should also be tested thoroughly.
Personal opinion (if applicable)
This is probably a good first issue for contributors.
It also might be worth considering making the check_page_range
function a form field validator and/or overriding Form.clean
- see https://docs.djangoproject.com/en/4.2/ref/forms/validation/