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

Strip username before login and add unit test #5095

Closed
wants to merge 4 commits into from

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Aug 4, 2023

Description

This PR addresses issue #5056 by adding functionality to strip leading and trailing spaces from the username during the login process. The changes are made in the login function in the gradio/routes.py script. Additionally, a unit test is added in the test/test_routes.py script to ensure the stripping functionality works as expected.

Summary of Changes

  • Modified the login function in gradio/routes.py to strip leading and trailing spaces from the username before processing the login.
  • Added a new test function in test/test_routes.py to test the login route with a username that has leading and trailing spaces. The test asserts that the login is successful and the username stored in the session is the stripped username.

Please review and merge this PR. Thank you!

Fixes #5056.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/strip-username

To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.

@vercel
Copy link

vercel bot commented Aug 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
gradio ✅ Ready (Inspect) Visit Preview Aug 4, 2023 4:01pm

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Aug 4, 2023

GitHub actions yielded the following error.

The command that failed is cat CHANGELOG.md client/python/CHANGELOG.md | grep -w "https://github.com/gradio-app/gradio/pull/5095". Here are the relevant lines from the logs:

##[group]Run cat CHANGELOG.md client/python/CHANGELOG.md | grep -w "https://github.com/gradio-app/gradio/pull/5095"
�[36;1mcat CHANGELOG.md client/python/CHANGELOG.md | grep -w "https://github.com/gradio-app/gradio/pull/5095"�[0m
shell: /usr/bin/bash -e {0}
##[endgroup]
##[error]Process completed with exit code 1.

This is likely a linting or type-checking issue with the source code.

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Aug 4, 2023

GitHub actions yielded the following error.

The command that failed is cat CHANGELOG.md client/python/CHANGELOG.md | grep -w "https://github.com/gradio-app/gradio/pull/5095". Here are the relevant lines from the logs:

##[group]Run cat CHANGELOG.md client/python/CHANGELOG.md | grep -w "https://github.com/gradio-app/gradio/pull/5095"
�[36;1mcat CHANGELOG.md client/python/CHANGELOG.md | grep -w "https://github.com/gradio-app/gradio/pull/5095"�[0m
shell: /usr/bin/bash -e {0}
##[endgroup]
##[error]Process completed with exit code 1.

This is likely a linting or type-checking issue with the source code.

@abidlabs
Copy link
Member

abidlabs commented Aug 4, 2023

No need to add the changelogs. I'll do it myself

@abidlabs abidlabs closed this Aug 4, 2023
@hannahblair
Copy link
Collaborator

Delete the file gradio/changelog.md

@gradio-pr-bot
Copy link
Contributor

Chromatic build successful 🎉

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.

None yet

3 participants