diff --git a/kallithea/lib/utils.py b/kallithea/lib/utils.py --- a/kallithea/lib/utils.py +++ b/kallithea/lib/utils.py @@ -322,7 +322,7 @@ ui_sections = ['alias', 'auth', 'ui', 'web', ] -def make_ui(repo_path=None, clear_session=True): +def make_ui(repo_path=None): """ Create an Mercurial 'ui' object based on database Ui settings, possibly augmenting with content from a hgrc file. @@ -342,8 +342,6 @@ def make_ui(repo_path=None, clear_sessio ui_.ui_key, ui_val) baseui.setconfig(safe_str(ui_.ui_section), safe_str(ui_.ui_key), ui_val) - if clear_session: - meta.Session.remove() # force set push_ssl requirement to False, Kallithea handles that baseui.setconfig('web', 'push_ssl', False) diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -1190,7 +1190,7 @@ class Repository(Base, BaseDbModel): Creates an db based ui object for this repository """ from kallithea.lib.utils import make_ui - return make_ui(clear_session=False) + return make_ui() @classmethod def is_valid(cls, repo_name): diff --git a/kallithea/model/repo.py b/kallithea/model/repo.py --- a/kallithea/model/repo.py +++ b/kallithea/model/repo.py @@ -290,7 +290,7 @@ class RepoModel(object): # clone_uri is modified - if given a value, check it is valid if clone_uri != '': # will raise exception on error - is_valid_repo_uri(cur_repo.repo_type, clone_uri, make_ui(clear_session=False)) + is_valid_repo_uri(cur_repo.repo_type, clone_uri, make_ui()) cur_repo.clone_uri = clone_uri if 'repo_name' in kwargs: @@ -360,7 +360,7 @@ class RepoModel(object): new_repo.private = private if clone_uri: # will raise exception on error - is_valid_repo_uri(repo_type, clone_uri, make_ui(clear_session=False)) + is_valid_repo_uri(repo_type, clone_uri, make_ui()) new_repo.clone_uri = clone_uri new_repo.landing_rev = landing_rev @@ -661,7 +661,7 @@ class RepoModel(object): backend = get_backend(repo_type) if repo_type == 'hg': - baseui = make_ui(clear_session=False) + baseui = make_ui() # patch and reset hooks section of UI config to not run any # hooks on creating remote repo for k, v in baseui.configitems('hooks'): diff --git a/kallithea/model/validators.py b/kallithea/model/validators.py --- a/kallithea/model/validators.py +++ b/kallithea/model/validators.py @@ -412,7 +412,7 @@ def ValidCloneUri(): if url and url != value.get('clone_uri_hidden'): try: - is_valid_repo_uri(repo_type, url, make_ui(clear_session=False)) + is_valid_repo_uri(repo_type, url, make_ui()) except Exception: log.exception('URL validation failed') msg = self.message('clone_uri', state)