# HG changeset patch # User Søren Løvborg # Date 2015-07-14 13:59:59 # Node ID a45113998d07aad2eb2f483c02111cbb257ba1e8 # Parent c5ff0bfefdf8a9730513fb8672bce90250cfe9e9 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. 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 @@ -64,10 +64,7 @@ class AuthSettingsController(BaseControl 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"] = {}