Mercurial > kallithea
changeset 5261:46011fe63e75
AuthSettingsController: don't add auth settings to tmpl_context
Do not import auth setting into the template context, since the values
are not actually used, except for 'auth_plugins'.
For 'auth_plugins', use the existing (and identical) 'enabled_plugins'
attribute instead.
author | Søren Løvborg <kwi@kwi.dk> |
---|---|
date | Tue, 14 Jul 2015 13:59:59 +0200 |
parents | a100a3af27f8 |
children | b41bdfdb3b16 |
files | kallithea/controllers/admin/auth_settings.py kallithea/templates/admin/auth/auth_settings.html |
diffstat | 2 files changed, 3 insertions(+), 7 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 @@ -63,15 +63,11 @@ def index(self, defaults=None, errors=None, prefix_error=False): self.__load_defaults() - # Import all auth settings into the template context. - for k, v in Setting.get_auth_settings().iteritems(): - setattr(c, k, v) - c.defaults = {} c.plugin_settings = {} c.plugin_shortnames = {} - for module in c.auth_plugins: + for module in c.enabled_plugins: plugin = auth_modules.loadplugin(module) plugin_name = plugin.name c.plugin_shortnames[module] = plugin_name @@ -85,7 +81,7 @@ if setting: c.defaults[fullname] = setting.app_settings_value # we want to show , separated list of enabled plugins - c.defaults['auth_plugins'] = ','.join(c.auth_plugins) + c.defaults['auth_plugins'] = ','.join(c.enabled_plugins) if defaults: c.defaults.update(defaults)
--- a/kallithea/templates/admin/auth/auth_settings.html Tue Jul 14 13:59:59 2015 +0200 +++ b/kallithea/templates/admin/auth/auth_settings.html Tue Jul 14 13:59:59 2015 +0200 @@ -46,7 +46,7 @@ </div> </div> - %for cnt, module in enumerate(c.auth_plugins): + %for cnt, module in enumerate(c.enabled_plugins): <% pluginName = c.plugin_shortnames[module] %> <h1>${_('Plugin')}: ${pluginName}</h1> <div class="fields">