Anti spam and accentuate letters when registering to the forum

Bug #892475 reported by TREMEL François on 2011-11-19
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Widelands Website

Bug Description

When I'm registering to the forum, the anti spam system show me words with accent (letters like é, è,..).
This is not a problem for me as I'm French and my keyboard does have the accentuate letters. But when I registered a server error occur. I try couple of time with the same result. Then I request to change the words up to have words without accent and I finally achieve to register.

SirVer (sirver) wrote :

Thanks for reporting. This is the traceback I got on the server:

Traceback (most recent call last):

 File "/var/www/django_projects/wlwebsite/lib/python2.6/site-packages/django/core/handlers/", line 111, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/var/www/django_projects/wlwebsite/code/widelands/mainpage/", line 30, in register
   if form.is_valid():

 File "/var/www/django_projects/wlwebsite/lib/python2.6/site-packages/django/forms/", line 121, in is_valid
   return self.is_bound and not bool(self.errors)

 File "/var/www/django_projects/wlwebsite/lib/python2.6/site-packages/django/forms/", line 112, in _get_errors

 File "/var/www/django_projects/wlwebsite/lib/python2.6/site-packages/django/forms/", line 267, in full_clean

 File "/var/www/django_projects/wlwebsite/lib/python2.6/site-packages/django/forms/", line 284, in _clean_fields
   value = field.clean(value)

 File "/var/www/django_projects/wlwebsite/code/widelands/wlrecaptcha/", line 76, in clean
   value = validate_recaptcha(self.remote_ip, challenge, response)

 File "/var/www/django_projects/wlwebsite/code/widelands/wlrecaptcha/", line 111, in validate_recaptcha

 File "/usr/lib/python2.6/", line 1267, in urlencode
   v = quote_plus(str(v))

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 7: ordinal not in range(128)

Changed in widelands-website:
status: New → Confirmed
importance: Undecided → Medium
kaputtnik (franku) wrote :

The server error is gone, now an error message is shown in the form (e.g. username: 'test_accents_é_è'):

"Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters."

This is an error from Django, because it does not use utf8 encoding as default for usernames. This will be fixed in Django 1.10. when using python3. When using python2 and Django 1.10 default will ever be ASCII, but with the option for unicode. See the box in:

The current behavior with the provided error message is not the best, but better then the old behavior (server error). Is this Error message helpful?

GunChleoc (gunchleoc) wrote :

Yes, that's a pretty standard error message and people should be familiar with seeing such messages.

kaputtnik (franku) wrote :

So this bug is somehow fixed.

Feel free to reopen it again.

Changed in widelands-website:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers