[multiple] User objects with UTF-8 encoded characters issues a 500 error

This has been happening for a while now.

How to reproduce:

  1. On the production system create a new library
  2. Type the name test (for example)
  3. On the code editor, type è in a comment:
  4. Press the save button

Results in: 500 error and the likes of the e-mail below being sent.

Internal Server Error: /platform/api/v1/libraries/anjos/test/1/
Traceback (most recent call last):
  File "/remote/sw/beat.env.web-0.0.1/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 164, in get_response
    response = response.render()
  File "/remote/sw/beat.env.web-0.0.1/usr/lib/python2.7/site-packages/django/template/response.py", line 158, in render
    self.content = self.rendered_content
  File "/remote/sw/beat.env.web-0.0.1/usr/lib/python2.7/site-packages/rest_framework/response.py", line 60, in rendered_content
    ret = renderer.render(self.data, media_type, context)
  File "/remote/sw/beat.env.web-0.0.1/usr/lib/python2.7/site-packages/rest_framework/renderers.py", line 103, in render
    separators=separators
  File "/remote/sw/beat.env.web-0.0.1/usr/lib/python2.7/json/__init__.py", line 250, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "/remote/sw/beat.env.web-0.0.1/usr/lib/python2.7/json/encoder.py", line 210, in encode
    return ''.join(chunks)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)

Request repr():
<WSGIRequest
path:/platform/api/v1/libraries/anjos/test/1/,
GET:<QueryDict: {u'include_fields': [u'html_description,history,referenced_libraries,referencing_libraries,referencing_algorithms']}>,
POST:<QueryDict: {}>,
COOKIES:{'__utma': '151489706.2013285428.1430744581.1441194617.1451987987.6',
 '__utmc': '151489706',
 '__utmz': '151489706.1437049090.3.2.utmcsr=beatweb-staging|utmccn=(referral)|utmcmd=referral|utmcct=/',
 '_ga': 'GA1.2.2013285428.1430744581',
 '_gat': '1',
 'csrftoken': 'O4LbgXMrg55StC50UCumvJVzGUPYkvZ1',
 'sessionid': 'ygnl9a93aj8tg3ydr2tttujtfd1zsha8'},
META:{'CONTENT_LENGTH': '',
 'CONTENT_TYPE': '',
 u'CSRF_COOKIE': u'O4LbgXMrg55StC50UCumvJVzGUPYkvZ1',
 'HTTP_ACCEPT': '*/*',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, sdch',
 'HTTP_ACCEPT_LANGUAGE': 'pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4,fr-FR;q=0.2',
 'HTTP_CONNECTION': 'Keep-Alive',
 'HTTP_COOKIE': '__utma=151489706.2013285428.1430744581.1441194617.1451987987.6; __utmc=151489706; __utmz=151489706.1437049090.3.2.utmcsr=beatweb-staging|utmccn=(referral)|utmcmd=referral|utmcct=/; sessionid=ygnl9a93aj8tg3ydr2tttujtfd1zsha8; _gat=1; csrftoken=O4LbgXMrg55StC50UCumvJVzGUPYkvZ1; _ga=GA1.2.2013285428.1430744581',
 'HTTP_HOST': 'beatweb.lab.idiap.ch',
 'HTTP_REFERER': 'https://www.beat-eu.org/platform/libraries/anjos/test/1/',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36',
 'HTTP_X_CSRFTOKEN': 'O4LbgXMrg55StC50UCumvJVzGUPYkvZ1',
 'HTTP_X_FORWARDED_FOR': '172.20.19.10',
 'HTTP_X_FORWARDED_HOST': 'www.beat-eu.org',
 'HTTP_X_FORWARDED_SERVER': 'www.beat-eu.org',
 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
 'PATH_INFO': u'/platform/api/v1/libraries/anjos/test/1/',
 'QUERY_STRING': 'include_fields=html_description,history,referenced_libraries,referencing_libraries,referencing_algorithms',
 'REMOTE_ADDR': '172.30.90.51',
 'REQUEST_METHOD': 'GET',
 u'SCRIPT_NAME': u'',
 'SERVER_ADDR': '172.31.100.250',
 'SERVER_NAME': 'www.beat-eu.org',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'X_FORWARDED_HOST': 'www.beat-eu.org',
 'X_FORWARDED_PROTO': 'https',
 'uwsgi.node': 'beatweb.lab.kvm',
 'uwsgi.version': '2.0.11.1',
 'wsgi.errors': <open file 'wsgi_errors', mode 'w' at 0x7f8163595150>,
 'wsgi.file_wrapper': <built-in function uwsgi_sendfile>,
 'wsgi.input': <uwsgi._Input object at 0x7f815f9f8d20>,
 'wsgi.multiprocess': True,
 'wsgi.multithread': False,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>