(fix) Remove unnecessary IPC request to Platform to get pennid#403
Merged
Conversation
…the id field of user)
jonathanmelitski
approved these changes
Feb 25, 2026
Contributor
jonathanmelitski
left a comment
There was a problem hiding this comment.
I'm good with it:
- If @ryantanen gives it the okay
- If your question in slack (which I also commented on) is answered in the affirmative.
Thanks.
| url = f"{PENNGROUPS_URL}{pennid}/groups" | ||
| try: | ||
| # user.id is the pennid (set by LabsUserBackend at authentication time) | ||
| url = f"{PENNGROUPS_URL}{user.id}/groups" |
Contributor
There was a problem hiding this comment.
just confirming that the user.id is the numerical id and not the pennkey, though I'm sure you tested
Contributor
There was a problem hiding this comment.
Yes it's the numerical ID
| # No bearer token available, re-raise the original IPC error | ||
| raise PermissionDenied(f"IPC request failed: {str(ipc_error)}") | ||
| """Returns Platform user information""" | ||
| response = authenticated_request(user, "GET", "https://platform.pennlabs.org/accounts/me/") |
Contributor
There was a problem hiding this comment.
not sure we should leave a call in here which has known issues, but as long as we keep it top-of-mind, i'm good with pushing with this function still in prod.
I just dont want someone two years from now using that function as if its 100% reliable
Contributor
There was a problem hiding this comment.
@darrentweng Maybe just add a comment in the code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PennID is presumably the id field of the User model (other members like Minghan or Ryan can fact-check me on this), so the Platform call is unnecessary.