Changeset - 8eebcf50fdd5
[Not reviewed]
default
0 1 0
Mads Kiilerich - 10 years ago 2016-01-05 16:30:12
madski@unity3d.com
auth: get username as str when container auth gets username from user object

Avoid stray unicode username.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/auth_modules/auth_container.py
Show inline comments
 
@@ -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
0 comments (0 inline, 0 general)