# HG changeset patch # User Thomas De Schampheleire # Date 2018-04-23 22:06:37 # Node ID 6e75963503cc53f22787f6a8ca14a608f9b23c40 # Parent 861ef58bc36e20494a51b8a2e12e557979ad1f61 admin: auth: make sure list of auth modules is consistent When authentication modules are enabled, but fail to be enabled e.g. due to missing dependencies (pam, ldap), the list of enabled plugins still contains the failing module. However, the 'Enabled/Disabled' button correctly shows Disabled, causing a mismatch between both. Worse, the mismatch cannot be corrected by clicking the Enabled/Disabled button, one needs to manually clear the problematic entry in the list of enabled plugins. Fix by always populating the list with the actually enabled plugins, not those requested by the user in case there are failures. diff --git a/kallithea/controllers/admin/auth_settings.py b/kallithea/controllers/admin/auth_settings.py --- a/kallithea/controllers/admin/auth_settings.py +++ b/kallithea/controllers/admin/auth_settings.py @@ -79,12 +79,12 @@ class AuthSettingsController(BaseControl setting = Setting.get_by_name(fullname) if setting is not None: c.defaults[fullname] = setting.app_settings_value + if defaults: + c.defaults.update(defaults) + # we want to show , separated list of enabled plugins c.defaults['auth_plugins'] = ','.join(c.enabled_plugin_names) - if defaults: - c.defaults.update(defaults) - log.debug(formatted_json(defaults)) return formencode.htmlfill.render( render('admin/auth/auth_settings.html'),