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 #5094

Closed
wants to merge 2 commits into from

Conversation

sweep-ai[bot]
Copy link
Contributor

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

Description

This PR addresses the issue #5056 by modifying the login route in gradio/routes.py to strip the username of any leading or trailing spaces before processing the login request. Additionally, a new unit test is added in test/test_routes.py to verify that the username is correctly stripped during the login process.

Summary of Changes

  • Modified the login route in gradio/routes.py to strip the username of any leading or trailing spaces.
  • Added a new test function in test/test_routes.py to verify the correct stripping of the username during the login process.
  • Updated the documentation and comments to reflect the changes made.

This PR ensures that the username input is properly handled during the login process, preventing any unexpected behavior caused by leading or trailing spaces in the username.

Fixes #5056.


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

git checkout sweep/strip-username-login-test

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 3:49pm

@sweep-ai sweep-ai bot closed this Aug 4, 2023
@sweep-ai sweep-ai bot deleted the sweep/strip-username-login-test branch August 4, 2023 15:50
@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/5094". 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/5094"
�[36;1mcat CHANGELOG.md client/python/CHANGELOG.md | grep -w "https://github.com/gradio-app/gradio/pull/5094"�[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

Reopen this PR please

@gradio-pr-bot
Copy link
Collaborator

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.

2 participants