# HG changeset patch # User Thomas De Schampheleire # Date 2019-11-30 19:55:45 # Node ID f9801165dc97c57ffabe2210b8ae830b7afa6eb8 # Parent 09c92e6995fd1db01100aab9f56822ce058850d7 admin: fix 'Settings > Visual' form validation after commit 574218777086 Commit 574218777086 introduced a setting for 'SSH Clone URL' in 'Admin > Settings > Visual' and placed it under a check 'if c.ssh_enabled', which means that the corresponding form field is not present when SSH is not enabled. In this case, when trying to save the form (changing any or none setting), form validation reports an error 'Missing value' without much detail. At the top of the HTML document, even before the opening HTML tag, we can see: Missing value
Fix this problem by adding a hidden form field for clone_ssh_tmpl, with the current value from the database, in case SSH is not enabled. diff --git a/kallithea/templates/admin/settings/settings_visual.html b/kallithea/templates/admin/settings/settings_visual.html --- a/kallithea/templates/admin/settings/settings_visual.html +++ b/kallithea/templates/admin/settings/settings_visual.html @@ -58,6 +58,8 @@ ${h.form(url('admin_settings_visual'), m ${h.text('clone_ssh_tmpl', size=80, class_='form-control')} ${_('''Schema for constructing SSH clone URL, eg. 'ssh://{system_user}@{hostname}/{repo}'.''')} + %else: + ${h.hidden('clone_ssh_tmpl', size=80, class_='form-control')} %endif