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

Override spam checks when adding or editing books #6419

Merged

Conversation

jimchamp
Copy link
Collaborator

Closes #6363

Spam checks for adding new books and editing works and editions are now skipped if the request was submitted by an admin or librarian.

Spam checks for creating new lists and updating patron profiles have not been affected.

Technical

New boolean parameter allow_privileged_edits has been added to is_spam(). If ever we want to bypass list and profile spam checks, we need only add the parameter to those is_spam() calls.

Testing

Test BAU functionality:

  1. Log in as a non-privileged patron.
  2. Attempt to add a book that contains a spam word in it's title. Expect this to fail.
  3. Navigate to a book page and click the edit button. Attempt to add a spam word to any edition field and submit the form. This should fail.
  4. Repeat step three, but add a spam word to a work field instead. Expect this to fail.

Test new functionality:

  1. Log in as an admin or librarian.
  2. Repeat steps 2 through 4 in the "Test BAU functionality" section, above. Expect each step to succeed, and ensure that they do.
  3. Don't forget to delete the new book (if it is not real), and revert all edits (if they were not real edits).

Screenshot

Stakeholders

@jimchamp jimchamp added the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Apr 12, 2022
@mekarpeles
Copy link
Member

perfect, thank you

@mekarpeles mekarpeles merged commit 7894f71 into internetarchive:master Apr 15, 2022
@jimchamp jimchamp removed the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label May 16, 2022
@jimchamp jimchamp deleted the 6363/bug/sspamword-bypass branch July 15, 2022 23:07
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.

Spamwords should not block librarian/admin edits
2 participants