-
Notifications
You must be signed in to change notification settings - Fork 348
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
refactor: Rework community views to operate on Person instead of User #5899
refactor: Rework community views to operate on Person instead of User #5899
Conversation
…he URL This only happens using the form-filling and submission feature of WebTest, which is only used in this one test case, so just it rip out.
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.
I have a few suggestions. The only one I consider essential is giving a clear error description if lookup_community_list
encounters multiple matches.
ietf/community/utils.py
Outdated
if hasattr(request.user, 'person') and request.user.person in persons: | ||
person = request.user.person | ||
else: | ||
raise MultiplePersonError("\r\n".join([p.user.username for p in persons])) |
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.
I think this will just return a list of usernames, which winds up displayed as the response if a user hits this. It'd be nice to provide a bit more context in the error message.
(If you're testing this in the dev browser, that often provides a much richer response when it hits an exception than happens in production)
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, I'm not really happy with it, but it was copied from Henrik's code in person.views.photo
. I played with the idea of returning a selection list, or of showing all matching community lists on one page (as in person.views.profile
), but ultimately punted in favor of preferring the logged-in user - if I'm John Doe, I probably want my community list rather than any other John Doe's. Ultimately, this is (hopefully) an extreme edge case.
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.
That makes sense - I'm just imagining something like "Found multiple matches: " at the start of the error message to give the response some meaning for a poor user who happens upon this.
I'm planning to hold this for merge/release until after IETF 117 |
I was being silly - the plan is to hold merging feat/user2person into main - no reason to block merging this PR into feat/user2person. |
Fixes #5859