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

AO3-6872 Only notify creators when a work is added to a collection by an archivist #5024

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/collection_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def notify_of_association
# Sends emails to item creator(s) in the case that an archivist
# has added them to the collection.
def notify_archivist_added
return unless User.current_user&.archivist && collection.user_is_maintainer?(User.current_user)
return unless item.is_a?(Work) && User.current_user&.archivist && collection.user_is_maintainer?(User.current_user)

item.users.each do |email_recipient|
next if email_recipient.preference.collection_emails_off
Expand Down
10 changes: 10 additions & 0 deletions features/bookmarks/bookmark_create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -448,3 +448,13 @@ Scenario: A bookmark with duplicate tags other than capitalization has only firs
And I fill in "Relationships" with "Relationship 1, Relationship 2"
And I press "Create"
Then I should see "Fandom, relationship, and character tags must not add up to more than 5. You have entered 6 of these tags, so you must remove 1 of them."

Scenario: Archivists can add bookmarks to collections
Given I have an archivist "archivist"
And I am logged in as "archivist"
And I create the collection "My Collection" with name "MyCollection"
When I open a bookmarkable work
And I follow "Bookmark"
And I fill in "bookmark_collection_names" with "MyCollection"
And I press "Create"
Then I should see "Bookmark was successfully created"
Loading