Special Characters

Hey there,

I just migrated my testing system to 2.0 from 1.2.
I just tried adding a colleague as an administrator.
His last name is Röhrig so this error appears:
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\xf6’ in position 7: ordinal not in range(128)
Where can I set which character codes can be used in the system?

Best Regards

This is a bug. Please provide a full traceback, since I cannot reproduce it - adding someone named ‘Röhrig’ as an admin on my local test instance worked fine.

Looking at the traceback I guess I forgot essential information that this is a LDAP User.

2017-12-07 10:19:37,177  7d13b3f539bc4dfa  indico.flask - ERROR errors.py:107 -- Uncaught Exception

Traceback (most recent call last):
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/flask/util.py", line 114, in wrapper
    return obj().process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py", line 270, in process
    res = self._do_process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py", line 249, in _do_process
    return self._process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/users/controllers.py", line 369, in _process
    external=external, allow_system_user=True, **form_data)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/users/util.py", line 239, in search_users
    for ident in identities:
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask_multipass/core.py", line 347, in search_identities
    for identity_info in provider.search_identities(provider.map_search_criteria(criteria), exact=exact):
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask_multipass/providers/ldap/providers.py", line 190, in search_identities
    for _, user_data in self._search_users(search_filter):
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask_multipass/providers/ldap/operations.py", line 95, in search
    serverctrls=[page_ctrl], timeout=settings['timeout'])
  File "/opt/indico/.venv/lib/python2.7/site-packages/ldap/ldapobject/simple.py", line 828, in search_ext
  File "/opt/indico/.venv/lib/python2.7/site-packages/ldap/ldapobject/simple.py", line 91, in _ldap_call
    result = func(*args, **kwargs)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 7: ordinal not in range(128)

{u'data': {u'get': {},
           u'headers': {'Accept': u'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
                        'Accept-Encoding': u'gzip, deflate, br',
                        'Accept-Language': u'de,en-US;q=0.7,en;q=0.3',
                        'Connection': u'keep-alive',
                        'Content-Length': u'120',
                        'Content-Type': u'application/x-www-form-urlencoded',
                        'Cookie': u'indico_session=***,
                        'Host': u'vm-0-203.ostk.dkfz-heidelberg.de',
                        'Referer': u'https://vm-0-203.ostk.dkfz-heidelberg.de/admin/users/',
                        'Upgrade-Insecure-Requests': u'1',
                        'User-Agent': u'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0'},
           u'json': None,
           u'post': {'affiliation': u'',
                     'csrf_token': u'fc9174d0-8eb1-4557-9ba2-4eccba1fda0b',
                     'email': u'',
                     'exact': u'y',
                     'external': u'y',
                     'first_name': u'',
                     'last_name': u'r\xf6hrig'},
           u'url': {}},
 u'endpoint': u'users.users_admin',
 u'id': '7d13b3f539bc4dfa',
 u'ip': '',
 u'method': 'POST',
 u'referrer': 'https://vm-0-203.ostk.dkfz-heidelberg.de/admin/users/',
 u'rh': 'RHUsersAdmin',
 u'time': '2017-12-07T10:19:37.285197',
 u'url': u'https://vm-0-203.ostk.dkfz-heidelberg.de/admin/users/',
 u'user': {u'email': u'indico@dkfz-heidelberg.de',
           u'id': 1,
           u'name': u'Alexander Bauer'},
 u'user_agent': u'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0'}

Did you add any custom code modifications to always search external users? The search dialog on the admin management page shouldn’t even allow you to select “users with no indico account”.

Sorry for the misinformation.
I wanted to add him to the Admins and couldn’t find the check for external user so I went and searched for him in the Users section, checked external and then this appeared.
Sorry again

Ah ok, that’s a known problem with the ldap identity provider that it currently fails when you use non-ascii characters: https://github.com/indico/flask-multipass/issues/19

FYI, this is now fixed and the new flask-multipass version will be used in Indico 2.0rc2 (or 2.0 in case we don’t do a rc2 release)

OK thank you i just downloaded the 2.0rc2 and it works now