fix: 404 instead of 300 for ambiguous email_or_person #8004
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.
This changes both the CommunityList family of views and the Person photo view to return a 404 instead of a 300 if the
email_or_name
in the URL is ambiguous. In both cases, the old approach was attempting to be helpful but assumed that everyPerson
matched had aUser
whose username could be used as a unique identifier. That is not true, so something needs to be done.While the 300 response with a list of usernames (or email addresses) is arguably helpful and friendly, I don't think a 404 is wrong - we're just declaring that we don't have a CommunityList or Photo that can be found at that URL. In either context, someone who is bothered by the missing resource is likely to complain about it and we can address the underlying issue.
Fixes #8003