diff --git a/kallithea/lib/auth_modules/auth_container.py b/kallithea/lib/auth_modules/auth_container.py --- a/kallithea/lib/auth_modules/auth_container.py +++ b/kallithea/lib/auth_modules/auth_container.py @@ -27,7 +27,7 @@ Original author and date, and relevant c import logging from kallithea.lib import auth_modules -from kallithea.lib.utils2 import str2bool, safe_unicode +from kallithea.lib.utils2 import str2bool, safe_unicode, safe_str from kallithea.lib.compat import hybrid_property from kallithea.model.db import User, Setting @@ -182,7 +182,7 @@ class KallitheaAuthPlugin(auth_modules.K # only way to log in is using environ username = None if userobj: - username = getattr(userobj, 'username') + username = safe_str(getattr(userobj, 'username')) if not username: # we don't have any objects in DB, user doesn't exist, extract