Mercurial > kallithea
changeset 8841:79567af5523e
hooks: drop UI display of internal hooks - these hooks are just an implementation detail
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sun, 10 Jan 2021 22:10:34 +0100 |
parents | 644b7a16d29c |
children | e40717c471a0 |
files | kallithea/controllers/admin/settings.py kallithea/model/db.py kallithea/templates/admin/settings/settings_hooks.html kallithea/tests/functional/test_admin_settings.py |
diffstat | 4 files changed, 1 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/controllers/admin/settings.py Mon Jan 11 00:06:52 2021 +0100 +++ b/kallithea/controllers/admin/settings.py Sun Jan 10 22:10:34 2021 +0100 @@ -364,7 +364,6 @@ defaults = db.Setting.get_app_settings() defaults.update(self._get_hg_ui_settings()) - c.hooks = db.Ui.get_builtin_hooks() c.custom_hooks = db.Ui.get_custom_hooks() return htmlfill.render(
--- a/kallithea/model/db.py Mon Jan 11 00:06:52 2021 +0100 +++ b/kallithea/model/db.py Sun Jan 10 22:10:34 2021 +0100 @@ -354,14 +354,6 @@ return setting @classmethod - def get_builtin_hooks(cls): - q = cls.query() - q = q.filter(cls.ui_key.in_([cls.HOOK_UPDATE, cls.HOOK_REPO_SIZE])) - q = q.filter(cls.ui_section == 'hooks') - q = q.order_by(cls.ui_section, cls.ui_key) - return q.all() - - @classmethod def get_custom_hooks(cls): q = cls.query() q = q.filter(~cls.ui_key.in_([cls.HOOK_UPDATE, cls.HOOK_REPO_SIZE]))
--- a/kallithea/templates/admin/settings/settings_hooks.html Mon Jan 11 00:06:52 2021 +0100 +++ b/kallithea/templates/admin/settings/settings_hooks.html Sun Jan 10 22:10:34 2021 +0100 @@ -1,16 +1,3 @@ -<div class="form"> - <div class="form-group"> - <h4>${_('Built-in Mercurial Hooks (Read-Only)')}</h4> - % for hook in c.hooks: - <% input_id = hook.ui_key.replace('.', '_') %> - <label class="control-label" for="${input_id}" title="${hook.ui_key}">${hook.ui_key}</label> - <div> - ${h.text(hook.ui_key,hook.ui_value,id=input_id,size=60,readonly="readonly",class_='form-control')} - </div> - % endfor - </div> -</div> - % if c.visual.allow_custom_hooks_settings: ${h.form(url('admin_settings_hooks'), method='post')} <div class="form">
--- a/kallithea/tests/functional/test_admin_settings.py Mon Jan 11 00:06:52 2021 +0100 +++ b/kallithea/tests/functional/test_admin_settings.py Sun Jan 10 22:10:34 2021 +0100 @@ -33,6 +33,7 @@ def test_index_hooks(self): self.log_user() response = self.app.get(base.url('admin_settings_hooks')) + response.mustcontain(no='.kallithea_') def test_create_custom_hook(self): self.log_user() @@ -96,8 +97,6 @@ _session_csrf_secret_token=self.session_csrf_secret_token())) self.checkSessionFlash(response, 'reserved for internal use') - response = response.follow() - response.mustcontain('changegroup.kallithea_update') def test_index_search(self): self.log_user()