changeset 5257:a45113998d07

AuthSettingsController: assume 'auth_plugins' option exists In formglobals, the provided 'auth_plugins' default value is always replaced with the real database value, returned along with other plugin settings by Setting.get_auth_settings. We can safely assume that the database value exists, since not only does db_manage initialize the 'auth_plugins' option upon database creation, but other authentication modules already assume its existence. For instance, Settings.get_auth_plugins() is equivalent to Settings.get_auth_settings()['auth_plugins'] except that get_auth_plugins will throw AttributeError, not KeyError, if the 'auth_plugins' key does not exist in the database.
author Søren Løvborg <kwi@kwi.dk>
date Tue, 14 Jul 2015 13:59:59 +0200
parents c5ff0bfefdf8
children 04798ed1e1a7
files kallithea/controllers/admin/auth_settings.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/admin/auth_settings.py	Tue Jul 14 13:59:59 2015 +0200
+++ b/kallithea/controllers/admin/auth_settings.py	Tue Jul 14 13:59:59 2015 +0200
@@ -64,10 +64,7 @@
     def index(self, defaults=None, errors=None, prefix_error=False):
         self.__load_defaults()
         _defaults = {}
-        # default plugins loaded
-        formglobals = {
-            "auth_plugins": ["kallithea.lib.auth_modules.auth_internal"]
-        }
+        formglobals = {}
         formglobals.update(Setting.get_auth_settings())
         formglobals["plugin_settings"] = {}
         formglobals["auth_plugins_shortnames"] = {}