Changeset - 46011fe63e75
[Not reviewed]
default
0 2 0
Søren Løvborg - 10 years ago 2015-07-14 13:59:59
kwi@kwi.dk
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.
2 files changed with 3 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/auth_settings.py
Show inline comments
 
@@ -63,15 +63,11 @@ class AuthSettingsController(BaseControl
 
    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 @@ class AuthSettingsController(BaseControl
 
                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)
kallithea/templates/admin/auth/auth_settings.html
Show inline comments
 
@@ -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">
0 comments (0 inline, 0 general)