-
Notifications
You must be signed in to change notification settings - Fork 652
AO3-3245 Manually entering the post link for a closed collection gives a misleading error #5504
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
base: master
Are you sure you want to change the base?
Conversation
marcus8448
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
…pdate translation key
|
Updated, thanks for the review marcus! |
marcus8448
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a minor (non-blocking) potential simplification in the tests.
| context "when collection is closed but user is maintainer" do | ||
| let(:user) { create(:user) } | ||
| let(:collection) { create(:collection, title: "Excalibur", collection_preference: create(:collection_preference, closed: true)) } | ||
| let!(:participant) { collection.collection_participants.create(pseud: user.default_pseud, participant_role: CollectionParticipant::MODERATOR) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to make this a bit more concise (and drop the eager let!) you could create the participant with factorybot and just use participant.user (superseding the user declaration).
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-3245 (Please fill in issue number and remove this comment.)
Purpose
Adds a check in the Works Controller to make sure a Collection isn't closed. If it is, and the User is not Owner or Moderator, it redirects them back to the collection index page with a message.
Credit
Scott (he/him)