diff --git a/kallithea/lib/db_manage.py b/kallithea/lib/db_manage.py --- a/kallithea/lib/db_manage.py +++ b/kallithea/lib/db_manage.py @@ -522,7 +522,7 @@ class DbManage(object): def create_user(self, username, password, email='', admin=False): log.info('creating user %s', username) UserModel().create_or_update(username, password, email, - firstname='Kallithea', lastname='Admin', + firstname=u'Kallithea', lastname=u'Admin', active=True, admin=admin, extern_type=EXTERN_TYPE_INTERNAL) @@ -532,8 +532,8 @@ class DbManage(object): user = UserModel().create_or_update(username=User.DEFAULT_USER, password=str(uuid.uuid1())[:20], email='anonymous@kallithea-scm.org', - firstname='Anonymous', - lastname='User') + firstname=u'Anonymous', + lastname=u'User') # based on configuration options activate/deactivate this user which # controls anonymous access if self.cli_args.get('public_access') is False: diff --git a/kallithea/lib/utils.py b/kallithea/lib/utils.py --- a/kallithea/lib/utils.py +++ b/kallithea/lib/utils.py @@ -186,7 +186,7 @@ def action_logger(user, action, repo, ip repo_obj = Repository.get_by_repo_name(repo_name) else: repo_obj = None - repo_name = '' + repo_name = u'' user_log = UserLog() user_log.user_id = user_obj.user_id @@ -451,7 +451,7 @@ def map_groups(path): rgm = RepoGroupModel(sa) owner = User.get_first_admin() for lvl, group_name in enumerate(groups): - group_name = '/'.join(groups[:lvl] + [group_name]) + group_name = u'/'.join(groups[:lvl] + [group_name]) group = RepoGroup.get_by_group_name(group_name) desc = '%s group' % group_name diff --git a/kallithea/model/user.py b/kallithea/model/user.py --- a/kallithea/model/user.py +++ b/kallithea/model/user.py @@ -100,8 +100,8 @@ class UserModel(BaseModel): log_create_user(new_user.get_dict(), cur_user) return new_user - def create_or_update(self, username, password, email, firstname='', - lastname='', active=True, admin=False, + def create_or_update(self, username, password, email, firstname=u'', + lastname=u'', active=True, admin=False, extern_type=None, extern_name=None, cur_user=None): """ Creates a new instance if not found, or updates current one @@ -191,7 +191,7 @@ class UserModel(BaseModel): # notification to admins subject = _('New user registration') body = ( - 'New user registration\n' + u'New user registration\n' '---------------------\n' '- Username: {user.username}\n' '- Full Name: {user.full_name}\n' diff --git a/kallithea/model/user_group.py b/kallithea/model/user_group.py --- a/kallithea/model/user_group.py +++ b/kallithea/model/user_group.py @@ -375,7 +375,7 @@ class UserGroupModel(BaseModel): for gr in set(groups): existing_group = UserGroup.get_by_group_name(gr) if not existing_group: - desc = 'Automatically created from plugin:%s' % extern_type + desc = u'Automatically created from plugin:%s' % extern_type # we use first admin account to set the owner of the group existing_group = UserGroupModel().create(gr, desc, owner, group_data={'extern_type': extern_type})