diff --git a/rhodecode/apps/admin/views/permissions.py b/rhodecode/apps/admin/views/permissions.py --- a/rhodecode/apps/admin/views/permissions.py +++ b/rhodecode/apps/admin/views/permissions.py @@ -68,7 +68,8 @@ class AdminPermissionsView(BaseAppView, c.user = User.get_default_user(refresh=True) - app_settings = SettingsModel().get_all_settings() + app_settings = c.rc_config + defaults = { 'anonymous': c.user.active, 'default_register_message': app_settings.get( diff --git a/rhodecode/apps/admin/views/settings.py b/rhodecode/apps/admin/views/settings.py --- a/rhodecode/apps/admin/views/settings.py +++ b/rhodecode/apps/admin/views/settings.py @@ -445,7 +445,7 @@ class AdminSettingsView(BaseAppView): def settings_issuetracker(self): c = self.load_default_context() c.active = 'issuetracker' - defaults = SettingsModel().get_all_settings() + defaults = c.rc_config entry_key = 'rhodecode_issuetracker_pat_' diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -289,7 +289,7 @@ def attach_context_attributes(context, r config = request.registry.settings rc_config = SettingsModel().get_all_settings(cache=True) - + context.rc_config = rc_config context.rhodecode_version = rhodecode.__version__ context.rhodecode_edition = config.get('rhodecode.edition') # unique secret + version does not leak the version but keep consistency diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -2246,8 +2246,12 @@ class Repository(Base, BaseModel): del override['ssh'] # we didn't override our tmpl from **overrides + request = get_current_request() if not uri_tmpl: - rc_config = SettingsModel().get_all_settings(cache=True) + if hasattr(request, 'call_context') and hasattr(request.call_context, 'rc_config'): + rc_config = request.call_context.rc_config + else: + rc_config = SettingsModel().get_all_settings(cache=True) if ssh: uri_tmpl = rc_config.get( 'rhodecode_clone_uri_ssh_tmpl') or self.DEFAULT_CLONE_URI_SSH @@ -2255,7 +2259,6 @@ class Repository(Base, BaseModel): uri_tmpl = rc_config.get( 'rhodecode_clone_uri_tmpl') or self.DEFAULT_CLONE_URI - request = get_current_request() return get_clone_url(request=request, uri_tmpl=uri_tmpl, repo_name=self.repo_name,