-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Good First IssueEasy issue. Good for newcomers. [managed]Easy issue. Good for newcomers. [managed]Lead: @jimchampIssues overseen by Jim (Front-end Lead, BookNotes) [managed]Issues overseen by Jim (Front-end Lead, BookNotes) [managed]Needs: HelpIssues, typically substantial ones, that need a dedicated developer to take them on. [managed]Issues, typically substantial ones, that need a dedicated developer to take them on. [managed]Needs: ResponseIssues which require feedback from leadIssues which require feedback from leadPriority: 4An issue, but should be worked on when no other pressing work can be done. [managed]An issue, but should be worked on when no other pressing work can be done. [managed]Type: BugSomething isn't working. [managed]Something isn't working. [managed]
Description
Problem
The Checkbox.checked property always returns False if no value is set on the Checkbox, even if the associated checkbox was checked.
However, if a value is set on a Checkbox, it returns True even if the checkbox is unchecked.
Reproducing the bug
Will likely require a debugger
- Go to the
/account/createpage - Tick the checkbox to sign up for IA newsletters
- Submit the form
- Inspect the value of the
ia_newsletterCheckbox'scheckedproperty
- Expected behavior:
checkedisTrue - Actual behavior:
checkedisFalse
Context
- Browser (Chrome, Safari, Firefox, etc): Any
- OS (Windows, Mac, etc): Any
- Logged in (Y/N): No
- Environment (prod, dev, local): prod
Breakdown
These Python Checkbox objects are only used by the account registration form, and I don't think that we have any plans to use any of our custom Python form Input objects in any other code paths. Let's remove the Checkbox definition and update the account registration template with HTML for the checkboxes.
Requirements Checklist
- Remove
Checkboxdefinition - Remove any
Checkboxinputs from the `RegisterForm' - Add HTML for checkboxes to the
/account/create.htmltemplate
Related files
Checkboxis defined in: https://github.com/internetarchive/openlibrary/blob/b434d3231c3b149cee785099ad1ba4494ac183c7/openlibrary/utils/form.py- Reference to login form in
/account/createPOST handler:f: forms.RegisterForm = self.get_form()
Stakeholders
Instructions for Contributors
- Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
Metadata
Metadata
Assignees
Labels
Good First IssueEasy issue. Good for newcomers. [managed]Easy issue. Good for newcomers. [managed]Lead: @jimchampIssues overseen by Jim (Front-end Lead, BookNotes) [managed]Issues overseen by Jim (Front-end Lead, BookNotes) [managed]Needs: HelpIssues, typically substantial ones, that need a dedicated developer to take them on. [managed]Issues, typically substantial ones, that need a dedicated developer to take them on. [managed]Needs: ResponseIssues which require feedback from leadIssues which require feedback from leadPriority: 4An issue, but should be worked on when no other pressing work can be done. [managed]An issue, but should be worked on when no other pressing work can be done. [managed]Type: BugSomething isn't working. [managed]Something isn't working. [managed]