diff --git a/kallithea/controllers/admin/settings.py b/kallithea/controllers/admin/settings.py --- a/kallithea/controllers/admin/settings.py +++ b/kallithea/controllers/admin/settings.py @@ -208,7 +208,8 @@ class SettingsController(BaseController) filesystem_repos = ScmModel().repo_scan() added, removed = repo2db_mapper(filesystem_repos, rm_obsolete, - install_git_hook=install_git_hooks) + install_git_hook=install_git_hooks, + user=c.authuser.username) _repr = lambda l: ', '.join(map(safe_unicode, l)) or '-' h.flash(_('Repositories successfully ' 'rescanned added: %s ; removed: %s') % diff --git a/kallithea/lib/utils.py b/kallithea/lib/utils.py --- a/kallithea/lib/utils.py +++ b/kallithea/lib/utils.py @@ -471,7 +471,7 @@ def map_groups(path): def repo2db_mapper(initial_repo_list, remove_obsolete=False, - install_git_hook=False): + install_git_hook=False, user=None): """ maps all repos given in initial_repo_list, non existing repositories are created, if remove_obsolete is True it also check for db entries @@ -486,7 +486,8 @@ def repo2db_mapper(initial_repo_list, re from kallithea.model.scm import ScmModel sa = meta.Session() repo_model = RepoModel() - user = User.get_first_admin() + if user is None: + user = User.get_first_admin() added = [] ##creation defaults