-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Problem with non ascii username submission #60
Comments
It looks like .format() is chocking on unicode characters. It should be this instead. return u"{0}:blocked:username:{1}".format(config.CACHE_PREFIX, username) If you want to submit a PR with this fix, that would be very helpful. We should also add a unit test for usernames with non ascii characters. |
Why not use |
@jedie not sure, I have to admit I'm horrible when it comes to unicode. If you feel that is the best way, feel free to submit a PR, and we can fix. |
Is this still a problem, or has it been fixed with one of the recent releases? |
I'm not able to reproduce this on python2, it would be nice to know which username had been passed around, I tried also to add a failing test but the test is passing |
hmm, maybe it was already fixed. It is probably a good idea to have a unit test with the unicode character as a regression test, incase we accidentally break it again in the future. |
how to write 60° in python because ° sign show error Your submission contains non ASCII characters, we don't accept submissions with non ASCII characters for this challenge. |
python 2.7
Django 1.8.13
django-defender 0.4.2
I cannot cleanup username filed, because defender handle post data before form validation, so if user submit non ascii username - defender raise UnicodeEncodeError exception.
The text was updated successfully, but these errors were encountered: