Cannot edit user (using container auth)

Issue #376 resolved
Bart Schapendonk created an issue

Since the user was created thru container auth. Only the username and firstname are set to the username. Email is empty!. Rhodecode seems to check of there is an old email {{{ File "/var/www/rhodecode-venv/local/lib/python2.7/site-packages/rhodecode/model/forms.py", line 490, in to_python if old_data.get('email', '').lower() != value: AttributeError: 'NoneType' object has no attribute 'lower' }}}

ps. I'm trying to user apache using mod_authnz_ldap with a reverse proxy to gunicorn.

complete stacktrace {{{ 2012-02-29 08:57:42.543 ERROR [rhodecode.controllers.admin.users] Traceback (most recent call last): File "/var/www/rhodecode-venv/local/lib/python2.7/site-packages/rhodecode/controllers/admin/users.py", line 116, in update form_result = _form.to_python(dict(request.POST)) File "/var/www/rhodecode-venv/local/lib/python2.7/site-packages/formencode/api.py", line 419, in to_python value = tp(value, state) File "/var/www/rhodecode-venv/local/lib/python2.7/site-packages/formencode/schema.py", line 153, in _to_python new[name] = validator.to_python(value, state) File "/var/www/rhodecode-venv/local/lib/python2.7/site-packages/formencode/api.py", line 419, in to_python value = tp(value, state) File "/var/www/rhodecode-venv/local/lib/python2.7/site-packages/formencode/compound.py", line 59, in _to_python to_python) File "/var/www/rhodecode-venv/local/lib/python2.7/site-packages/formencode/compound.py", line 124, in attempt_convert value = validate(validator, value, state) File "/var/www/rhodecode-venv/local/lib/python2.7/site-packages/formencode/compound.py", line 15, in to_python return validator.to_python(value, state) File "/var/www/rhodecode-venv/local/lib/python2.7/site-packages/rhodecode/model/forms.py", line 490, in to_python if old_data.get('email', '').lower() != value: AttributeError: 'NoneType' object has no attribute 'lower' }}}

Comments (3)

  1. Marcin Kuzminski repo owner

    O right, that might be a problem. I think a simple

    if (old_data.get('email', '') or '').lower() != value:
    

    Should do the trick. Can you check if this wouldn't generate any problems ?

  2. Bart Schapendonk reporter

    Yes it works and solves the crash. Now the email validation fails (red form field), but that's ok, just enter an email and it works.

    Thx

  3. Log in to comment