# HG changeset patch # User Mads Kiilerich # Date 1610313034 -3600 # Node ID 79567af5523e48086352b2cbc1ca13544bb91e54 # Parent 644b7a16d29cfbbf0edcead1a2f3eaf0b89dbadb hooks: drop UI display of internal hooks - these hooks are just an implementation detail diff -r 644b7a16d29c -r 79567af5523e kallithea/controllers/admin/settings.py --- 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( diff -r 644b7a16d29c -r 79567af5523e kallithea/model/db.py --- 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])) diff -r 644b7a16d29c -r 79567af5523e kallithea/templates/admin/settings/settings_hooks.html --- 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 @@ -
-
-

${_('Built-in Mercurial Hooks (Read-Only)')}

- % for hook in c.hooks: - <% input_id = hook.ui_key.replace('.', '_') %> - -
- ${h.text(hook.ui_key,hook.ui_value,id=input_id,size=60,readonly="readonly",class_='form-control')} -
- % endfor -
-
- % if c.visual.allow_custom_hooks_settings: ${h.form(url('admin_settings_hooks'), method='post')}
diff -r 644b7a16d29c -r 79567af5523e kallithea/tests/functional/test_admin_settings.py --- 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()