Show More
@@ -522,7 +522,7 b' class DbManage(object):' | |||
|
522 | 522 | def create_user(self, username, password, email='', admin=False): |
|
523 | 523 | log.info('creating user %s', username) |
|
524 | 524 | UserModel().create_or_update(username, password, email, |
|
525 | firstname='Kallithea', lastname='Admin', | |
|
525 | firstname=u'Kallithea', lastname=u'Admin', | |
|
526 | 526 | active=True, admin=admin, |
|
527 | 527 | extern_type=EXTERN_TYPE_INTERNAL) |
|
528 | 528 | |
@@ -532,8 +532,8 b' class DbManage(object):' | |||
|
532 | 532 | user = UserModel().create_or_update(username=User.DEFAULT_USER, |
|
533 | 533 | password=str(uuid.uuid1())[:20], |
|
534 | 534 | email='anonymous@kallithea-scm.org', |
|
535 | firstname='Anonymous', | |
|
536 | lastname='User') | |
|
535 | firstname=u'Anonymous', | |
|
536 | lastname=u'User') | |
|
537 | 537 | # based on configuration options activate/deactivate this user which |
|
538 | 538 | # controls anonymous access |
|
539 | 539 | if self.cli_args.get('public_access') is False: |
@@ -186,7 +186,7 b' def action_logger(user, action, repo, ip' | |||
|
186 | 186 | repo_obj = Repository.get_by_repo_name(repo_name) |
|
187 | 187 | else: |
|
188 | 188 | repo_obj = None |
|
189 | repo_name = '' | |
|
189 | repo_name = u'' | |
|
190 | 190 | |
|
191 | 191 | user_log = UserLog() |
|
192 | 192 | user_log.user_id = user_obj.user_id |
@@ -451,7 +451,7 b' def map_groups(path):' | |||
|
451 | 451 | rgm = RepoGroupModel(sa) |
|
452 | 452 | owner = User.get_first_admin() |
|
453 | 453 | for lvl, group_name in enumerate(groups): |
|
454 | group_name = '/'.join(groups[:lvl] + [group_name]) | |
|
454 | group_name = u'/'.join(groups[:lvl] + [group_name]) | |
|
455 | 455 | group = RepoGroup.get_by_group_name(group_name) |
|
456 | 456 | desc = '%s group' % group_name |
|
457 | 457 |
@@ -100,8 +100,8 b' class UserModel(BaseModel):' | |||
|
100 | 100 | log_create_user(new_user.get_dict(), cur_user) |
|
101 | 101 | return new_user |
|
102 | 102 | |
|
103 | def create_or_update(self, username, password, email, firstname='', | |
|
104 | lastname='', active=True, admin=False, | |
|
103 | def create_or_update(self, username, password, email, firstname=u'', | |
|
104 | lastname=u'', active=True, admin=False, | |
|
105 | 105 | extern_type=None, extern_name=None, cur_user=None): |
|
106 | 106 | """ |
|
107 | 107 | Creates a new instance if not found, or updates current one |
@@ -191,7 +191,7 b' class UserModel(BaseModel):' | |||
|
191 | 191 | # notification to admins |
|
192 | 192 | subject = _('New user registration') |
|
193 | 193 | body = ( |
|
194 | 'New user registration\n' | |
|
194 | u'New user registration\n' | |
|
195 | 195 | '---------------------\n' |
|
196 | 196 | '- Username: {user.username}\n' |
|
197 | 197 | '- Full Name: {user.full_name}\n' |
@@ -375,7 +375,7 b' class UserGroupModel(BaseModel):' | |||
|
375 | 375 | for gr in set(groups): |
|
376 | 376 | existing_group = UserGroup.get_by_group_name(gr) |
|
377 | 377 | if not existing_group: |
|
378 | desc = 'Automatically created from plugin:%s' % extern_type | |
|
378 | desc = u'Automatically created from plugin:%s' % extern_type | |
|
379 | 379 | # we use first admin account to set the owner of the group |
|
380 | 380 | existing_group = UserGroupModel().create(gr, desc, owner, |
|
381 | 381 | group_data={'extern_type': extern_type}) |
General Comments 0
You need to be logged in to leave comments.
Login now