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
fix: Raise 404 when multiple person found in /community/personal/#7038
base: main
Are you sure you want to change the base?
Conversation
4cba512
to
051022d
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7038 +/- ##
=======================================
Coverage 88.97% 88.98%
=======================================
Files 291 291
Lines 40717 40717
=======================================
+ Hits 36229 36233 +4
+ Misses 4488 4484 -4 ☔ View full report in Codecov by Sentry. |
ietf/community/views.py
Outdated
@@ -54,7 +54,7 @@ def view_list(request, email_or_name=None): | |||
try: | |||
clist = lookup_community_list(request, email_or_name) | |||
except MultiplePersonError as err: | |||
return HttpResponse(str(err), status=300) | |||
raise Http404(str(err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should either 404 with no decoration or use some other response. I'm not quickly coming up with a use-case for telling someone that the string entered matches multiple people is helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! 404 page doesn't show any decorations. I'll remove error strings.
051022d
to
ebc0f61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to push the MultiplePersonError
-> 404 logic down into lookup_community_list()
? Is it used anywhere that a 404 isn't the right thing to do?
(I'm not actually a fan of helper directly 404ing, but that's a bigger set of changes...)
Yes, I think this would make sense, and it would obviate the need for the MultiplePerssonError exception in the first place - the utility could simply raise the 404 instead. |
No description provided.