AO3-7358 Fix 500 error when sending item_added_notification for bookmark of deleted work#5804
Open
Smuzzy-waiii wants to merge 1 commit into
Conversation
…of deleted work Fix 500 error sending item_added_notification for bookmark of deleted work The mail tries to reference .title of @creation.bookmarkable which errors out when @creation.bookmarkable is deleted. Updated the mail text to explicitly handle this case
Author
Author
|
@Bilka2 I don't have Jira perms yet, could you please set the ticket to In-Review/In-Progress? 😄 |
5 tasks
Bilka2
requested changes
May 25, 2026
Contributor
Bilka2
left a comment
There was a problem hiding this comment.
Could you add a test for this change?
The rest of my comments are just style nitpicks, nice work!
| <i><b><%= style_link(@creation.title.html_safe, work_url(@creation)) %></b></i> | ||
| <% else %> | ||
| <% if @creation.bookmarkable == nil %> | ||
| Bookmark of deleted item |
Contributor
There was a problem hiding this comment.
Normally, we'd prefer to internationalise text. But since that would significantly complicate the pull request, it's good to keep it like this for now. Just wanted to note it for the future
That said, could you indent this and the other line inside the else one step?
| <% if @creation.is_a?(Work) %> | ||
| <i><b><%= style_link(@creation.title.html_safe, work_url(@creation)) %></b></i> | ||
| <% else %> | ||
| <% if @creation.bookmarkable == nil %> |
Contributor
There was a problem hiding this comment.
Another style nitpick: Could you check unless @creation.bookmarkable instead?
|
|
||
|
|
||
| <%= @creation.is_a?(Work) ? @creation.pseuds.length > 0 ? pseuds : @creation.authors_to_sort_on : pseuds %> posted a <%= @creation.is_a?(Work) ? @creation.backdate ? "backdated " : "new " : "new " %> <%= @creation.is_a?(Work) ? "work" : "bookmark" %> to your collection, "<%= @collection.name %>" (<%= collection_url(@collection) %>: | ||
| <%= @creation.is_a?(Work) ? @creation.pseuds.length > 0 ? pseuds : @creation.authors_to_sort_on : pseuds %> posted a <%= @creation.is_a?(Work) ? @creation.backdate ? "backdated " : "new " : "new " %> <%= @creation.is_a?(Work) ? "work" : "bookmark" %> to your collection, "<%= @collection.name %>" (<%= collection_url(@collection) %>): |
Contributor
There was a problem hiding this comment.
Nice work spotting that missing parenthesis!
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
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-7358
Purpose
Fix 500 error sending
item_added_notificationfor bookmark of deleted workThe mail tries to reference
.titleof@creation.bookmarkablewhich errors out when@creation.bookmarkableis deleted. Updated the mail text to explicitly handle this caseCredit
Smaran Jawalkar (he/him)