repository: show recomendation for updating hooks if they are outdated.
This commit is contained in:
parent
c2c4e3a09b
commit
7e3d409bfe
2 changed files with 13 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ import logging
|
|||
|
||||
from pyramid.view import view_config
|
||||
from pyramid.httpexceptions import HTTPFound
|
||||
from packaging.version import Version
|
||||
|
||||
from rhodecode import events
|
||||
from rhodecode.apps._base import RepoAppView
|
||||
|
|
@ -70,6 +71,13 @@ class RepoSettingsView(RepoAppView):
|
|||
.filter(UserFollowing.follows_repository == self.db_repo).scalar()
|
||||
|
||||
c.ver_info_dict = self.rhodecode_vcs_repo.get_hooks_info()
|
||||
c.hooks_outdated = False
|
||||
|
||||
try:
|
||||
if Version(c.ver_info_dict['pre_version']) < Version(c.rhodecode_version):
|
||||
c.hooks_outdated = True
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# update commit cache if GET flag is present
|
||||
if self.request.GET.get('update_commit_cache'):
|
||||
|
|
|
|||
|
|
@ -147,6 +147,11 @@
|
|||
onclick="return confirm('${_('Confirm to reinstall hooks for this repository.')}');">
|
||||
${_('Update Hooks')}
|
||||
</a>
|
||||
% if c.hooks_outdated:
|
||||
<span class="alert-error" style="padding: 10px">
|
||||
${_('Outdated hooks detected, please update hooks using `Update Hooks` action.')}
|
||||
</span>
|
||||
% endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue