Skip to content

Conversation

@akramcodez
Copy link
Contributor

Closes #10731

Changes

  • Replaced custom Checkbox logic with standard HTML checkbox
  • Updated registration form and template to use default behavior
  • Verified checked boxes now correctly post values, unchecked omitted

Screenshot

image

Stakeholders

@jimchamp

@akramcodez
Copy link
Contributor Author

PTAL @jimchamp, thanks.

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Oct 31, 2025
Copilot AI review requested due to automatic review settings November 4, 2025 12:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the Internet Archive newsletter checkbox from being a form-rendered input to a hardcoded HTML input in the signup template.

  • Removes the ia_newsletter Checkbox field from the RegisterForm class
  • Adds direct HTML checkbox markup for ia_newsletter in the template
  • Updates the i18n message location from Python forms file to the HTML template

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
openlibrary/plugins/upstream/forms.py Removes the ia_newsletter Checkbox field definition from RegisterForm
openlibrary/templates/account/create.html Adds hardcoded HTML checkbox input for ia_newsletter with inline label
openlibrary/i18n/messages.pot Moves the newsletter checkbox text translation entry from forms.py to account/create.html

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +79 to +80
<input type="checkbox" id="ia_newsletter" name="ia_newsletter"/>
<label for="ia_newsletter">$:_('I want to receive news, announcements, and resources from the <a href="https://archive.org/">Internet Archive</a>, the non-profit that runs Open Library.')</label>
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

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

The two checkboxes now have inconsistent implementations. The ia_newsletter checkbox (lines 79-80) uses hardcoded HTML, while the pd_request checkbox (line 83) uses form rendering with $:form.pd_request.render(). This inconsistency makes the code harder to maintain. Consider either keeping both as form-rendered checkboxes or converting both to hardcoded HTML for consistency.

Suggested change
<input type="checkbox" id="ia_newsletter" name="ia_newsletter"/>
<label for="ia_newsletter">$:_('I want to receive news, announcements, and resources from the <a href="https://archive.org/">Internet Archive</a>, the non-profit that runs Open Library.')</label>
$:form.ia_newsletter.render() <label for="ia_newsletter">$:_('I want to receive news, announcements, and resources from the <a href="https://archive.org/">Internet Archive</a>, the non-profit that runs Open Library.')</label>

Copilot uses AI. Check for mistakes.
@akramcodez
Copy link
Contributor Author

could anyone please suggest if I can make both checkboxes the same?

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

Labels

Needs: Response Issues which require feedback from lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Checkbox.checked doesn't always return the expected result

2 participants