AO3-5717 Fix expected chapter count lower than actual count#4108
Merged
Conversation
Use wip_length instead of expected_number_of_chapters as the hidden field on work editing.
redsummernight
left a comment
Member
There was a problem hiding this comment.
Can you add a test for this behavior of wip_length? In spec/models/work_spec.rb, we can have a block for describe "#wip_length=" and check that setting the attribute to e.g. 2 for a work with 1 chapter will end up with both expected_number_of_chapters and wip_length at 1.
Contributor
|
Would you mind removing otwarchive/app/controllers/works_controller.rb Lines 893 to 896 in 72b975c Otherwise someone would still be able to manipulate the HTML to get an invalid chapter count. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Issue
https://otwarchive.atlassian.net/browse/AO3-5717
Purpose
Uses an existing virtual attribute so that the chapter count safeguards happen even if the chapter count provided is wrong.
Testing Instructions
In the JIRA ticket.
Credit
What name and pronouns should we use to credit you in the Archive of Our Own's Release Notes?
bird - (they)