Skip to content
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

made pennkeys lowercase and changed test case #680

Merged
merged 8 commits into from
Nov 14, 2024
Merged

made pennkeys lowercase and changed test case #680

merged 8 commits into from
Nov 14, 2024

Conversation

nruia-penn
Copy link
Contributor

@nruia-penn nruia-penn commented Oct 24, 2024

Made it so when people send friend requests on penn courses, it changes the username to all lowercase so that when people add friends and accidentally capitalize the first letter it still is able to find the friend they are looking for.

@nruia-penn nruia-penn requested a review from Clue88 October 24, 2024 17:48
Copy link
Contributor

@Clue88 Clue88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Left a comment for some edge cases

@shiva-menta
Copy link
Contributor

Just made all pennkeys lowercase. Made a test for it, seems to work.

Would also be great to add 1-2 sentences on why this is needed! It's helpful to have more documentation on why we're making changes.

@nruia-penn
Copy link
Contributor Author

Do you want me to add comments in the code or in some sort of documentation?

@shiva-menta
Copy link
Contributor

Do you want me to add comments in the code or in some sort of documentation?

Just within the PR itself would be sufficient. Something like this.

Copy link
Contributor

@shiva-menta shiva-menta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Requested some small fixes to make the code more succinct.

username = request.data.get("pennkey")
if not username:
res["message"] = "User not found"
return Response(res, status=status.HTTP_404_NOT_FOUND)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can make this more succinct and use raise Http404("User not found.").

username = request.data.get("pennkey")
if not username:
res["message"] = "User not found."
return Response(res, status=status.HTTP_404_NOT_FOUND)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here.

Copy link
Contributor

@shiva-menta shiva-menta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm – thanks Nikhil!

Copy link
Contributor

@Clue88 Clue88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great!

@nruia-penn nruia-penn merged commit 765d0c3 into master Nov 14, 2024
13 checks passed
@nruia-penn nruia-penn deleted the pennkeys branch November 14, 2024 16:48
luke-rt pushed a commit that referenced this pull request Feb 13, 2025
* made pennkeys lowercase and changed test case

* Added handling for edge cases

* fixed whitespace

* Fixed more whitespace. All stylizing

* changed the response schema

* made http404 message more succinct

* imports in alphabetical order I think

* removed one res = {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants