# HG changeset patch # User Marcin Kuzminski # Date 2019-01-14 19:26:45 # Node ID f260e60e9a3a4c7504e410c5a329c763addba328 # Parent d728b632f1a355f1ed8e6ce0ec65541747cdfe5f repositories: handle vcs backend unavailable correctly in advanced settings. diff --git a/rhodecode/apps/repository/views/repo_settings_advanced.py b/rhodecode/apps/repository/views/repo_settings_advanced.py --- a/rhodecode/apps/repository/views/repo_settings_advanced.py +++ b/rhodecode/apps/repository/views/repo_settings_advanced.py @@ -73,6 +73,8 @@ class RepoSettingsView(RepoAppView): 'repository.write', 'repository.read', 'repository.admin')( self.db_repo.fork.repo_name, 'repo set as fork page') + c.ver_info_dict = self.rhodecode_vcs_repo.get_hooks_info() + return self._get_template_context(c) @LoginRequired() diff --git a/rhodecode/templates/admin/repos/repo_edit_advanced.mako b/rhodecode/templates/admin/repos/repo_edit_advanced.mako --- a/rhodecode/templates/admin/repos/repo_edit_advanced.mako +++ b/rhodecode/templates/admin/repos/repo_edit_advanced.mako @@ -118,23 +118,26 @@

${_('Hooks')}

- <% ver_info_dict = c.rhodecode_db_repo.scm_instance().get_hooks_info() %> - - + % if c.ver_info_dict: - + - + + % else: + + + + % endif
${_('Hook type')} ${_('Hook version')} ${_('Current version')}
${_('PRE HOOK')}${ver_info_dict['pre_version']}${c.ver_info_dict['pre_version']} ${c.rhodecode_version}
${_('POST HOOK')}${ver_info_dict['post_version']}${c.ver_info_dict['post_version']} ${c.rhodecode_version}
${_('Unable to read hook information from VCS Server')}