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 within test_post_login #5096

Closed
wants to merge 1 commit into from

Conversation

sweep-ai[bot]
Copy link
Contributor

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

Description

This PR addresses the issue of spaces being kept at the beginning and end of the username's Textbox on the login page in gradio. The proposed solution is to modify the login route in the gradio/routes.py script to strip the username input before processing it. This will remove any leading or trailing spaces from the username, resolving the issue of spaces causing login problems.

Summary of Changes

  • Modified the login route in gradio/routes.py to apply the strip() method to the username input.
  • Updated the line username, password = form_data.username, form_data.password to username, password = form_data.username.strip(), form_data.password.
  • Added a unit test within test_post_login to verify the stripping of spaces from the username input.

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-login

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:02pm

@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/5096"

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/5096"
�[36;1mcat CHANGELOG.md client/python/CHANGELOG.md | grep -w "https://github.com/gradio-app/gradio/pull/5096"�[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.

@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

2 participants