# HG changeset patch # User Mads Kiilerich # Date 2020-03-30 16:10:54 # Node ID eabd5a2fd0aff5b8ab482ae6ffd26d6940e7583e # Parent 6484a0fc0e0bdfebd2ff1b2fc442b0346f0e9267 config: set base_path config in set_app_settings using Ui.get_repos_location() instead of in app_cfg using make_ui() Only hit the database once (when starting the application) to get this. It would perhaps be more elegant to set it directly, for example in kallithea.base_path ... but it seems like a setting that really belongs in the .ini file ... diff --git a/kallithea/config/app_cfg.py b/kallithea/config/app_cfg.py --- a/kallithea/config/app_cfg.py +++ b/kallithea/config/app_cfg.py @@ -40,8 +40,8 @@ from kallithea.lib.middleware.permanent_ from kallithea.lib.middleware.simplegit import SimpleGit from kallithea.lib.middleware.simplehg import SimpleHg from kallithea.lib.middleware.wrapper import RequestWrapper -from kallithea.lib.utils import check_git_version, load_rcextensions, make_ui, set_app_settings, set_indexer_config, set_vcs_config -from kallithea.lib.utils2 import safe_str, str2bool +from kallithea.lib.utils import check_git_version, load_rcextensions, set_app_settings, set_indexer_config, set_vcs_config +from kallithea.lib.utils2 import str2bool log = logging.getLogger(__name__) @@ -165,8 +165,6 @@ def setup_configuration(app): load_rcextensions(root_path=config['here']) - repos_path = safe_str(make_ui().configitems(b'paths')[0][1]) - config['base_path'] = repos_path set_app_settings(config) instance_id = kallithea.CONFIG.get('instance_id', '*') diff --git a/kallithea/lib/utils.py b/kallithea/lib/utils.py --- a/kallithea/lib/utils.py +++ b/kallithea/lib/utils.py @@ -365,6 +365,7 @@ def set_app_settings(config): hgsettings = Setting.get_app_settings() for k, v in hgsettings.items(): config[k] = v + config['base_path'] = Ui.get_repos_location() def set_vcs_config(config):