500 error when trying to sort prompt meme prompts by prompter if challenge has anonymous prompts

Description

Steps to reproduce

  1. Log in

  2. Create a prompt meme that has anonymous prompts

    1. Browse > Collections > New Collection

    2. Fill in required information

    3. For “Type of challenge, if any,” choose “Prompt Meme”

    4. Press “Submit”

    5. Press “Submit” on the challenge settings form to use default settings

  3. Create some prompts

    1. Follow “Prompt Form” in the sidebar

    2. Fill in information for at least one prompt

    3. Check “Semi-anonymous Prompt?”

    4. Press “Submit”

  4. Follow the “Prompts” link in the sidebar

  5. Realize there is no “Prompter” option for “Sort by,” and try to do it manually by modifying the URL: https://test.archiveofourown.org/collections/COLLECTION/requests?sort_column=prompter&sort_direction=ASC

What happens

A 500 error.

What should happen

It should fall back to the default sort column and order, just like if you entered “banana” or something meaningless.

Notes

This sounds like “Who’d do that?” but there is actually a way to encounter this organically: if you open the Prompts page when there are no anonymous prompts, “Prompter” will be a sort option. And if someone adds an anonymous prompt before you press the button to sort by prompter, you’ll get a 500 error when you do press it.

Activity

Show:

Details

Assignee

Reporter

Roadmap

Challenges

Priority

Affects versions

Components

BackEnd

Difficulty

Milestone

Sentry

Created March 18, 2025 at 9:13 AM
Updated April 13, 2025 at 10:02 PM