Setting yearly reading goal fails silently when goal is too large #9257
Labels
Good First Issue
Easy issue. Good for newcomers. [managed]
Lead: @jimchamp
Issues overseen by Jim (Front-end Lead, BookNotes) [managed]
Needs: Response
Issues which require feedback from lead
Needs: Review Assignee
Issues that may have been abandoned by assignees
Priority: 4
An issue, but should be worked on when no other pressing work can be done. [managed]
Theme: Yearly Reading Goals
Type: Bug
Something isn't working. [managed]
Problem
When a patron attempts to set a yearly reading goal that is greater than
2147483647
books, the request fails but no feedback about the failure is given to the patron.Evidence / Screenshot
Relevant URL(s)
Goals can be set here: https://openlibrary.org/account/books``
Reproducing the bug
Context
Notes from this Issue's Lead
Proposal & constraints
Setting a
max
value of2147483647
on the reading goal input element is a quick and acceptable solution. An ambitious contributor could also update the/reading-goal
POST handler to validate the goal immediately, and return an appropriate status code if the goal is out of range.Related files
Template for reading goal form:
https://github.com/internetarchive/openlibrary/blob/master/openlibrary/templates/check_ins/reading_goal_form.html
POST handler for reading log goal form:
openlibrary/openlibrary/plugins/upstream/checkins.py
Lines 199 to 232 in 708a80a
Stakeholders
The text was updated successfully, but these errors were encountered: