Skip to content

AO3-5657 Reassign tag set nominations when pseud is deleted#5926

Open
pmonfort wants to merge 2 commits into
otwcode:masterfrom
pmonfort:AO3-5657
Open

AO3-5657 Reassign tag set nominations when pseud is deleted#5926
pmonfort wants to merge 2 commits into
otwcode:masterfrom
pmonfort:AO3-5657

Conversation

@pmonfort

@pmonfort pmonfort commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-5657

Purpose

When a user deletes a pseud, tag set nominations associated with that pseud are left orphaned in the database. The owned_by scope uses an inner join through the pseud, so these orphaned nominations become invisible to the user.

This PR adds tag set nomination reassignment to Pseud#replace_me_with_default, following the same pattern used for comments, gifts, challenge signups, and collection participants. If the default pseud already has a nomination for the same tag set, the conflicting nomination from the deleted pseud is destroyed (along with its associated tag nominations via dependent: :destroy). Otherwise, the nomination is reassigned to the default pseud.

Testing Instructions

  1. Log in as User A.
  2. Go to Browse > Tags > Tag Sets > New Tag Set.
  3. Check the "Currently taking nominations?" box and set at least one nomination limit to a non-zero value.
  4. Fill in the rest of the fields and press "Submit" to create the tag set.
  5. Log in as User B.
  6. Go to My Preferences > Manage My Pseuds > New Pseud and create a new pseud.
  7. Fill in the fields as desired and press "Create" to create a new post.
  8. View the tag set created by User A and click "Nominate."
  9. Select the pseud that you just created.
  10. Nominate tags as desired, and then press "Submit."
  11. Go to My Preferences > Manage My Pseuds.
  12. Find the pseud that you just created/nominated for, and press the "Delete" button.
  13. View the tag set again and click "Nominate."
  14. Expected: You should be redirected to your existing nominations (now under your default pseud), not a new nomination form.

Credit

Pablo Monfort (he/him)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant