changeset 7258:6e75963503cc

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.
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Mon, 23 Apr 2018 22:06:37 +0200
parents 861ef58bc36e
children 6e270cedc8aa
files kallithea/controllers/admin/auth_settings.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/admin/auth_settings.py	Tue May 01 17:08:36 2018 +0200
+++ b/kallithea/controllers/admin/auth_settings.py	Mon Apr 23 22:06:37 2018 +0200
@@ -79,12 +79,12 @@
                 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'),