Changeset - 04798ed1e1a7
[Not reviewed]
default
0 2 0
Søren Løvborg - 10 years ago 2015-07-14 13:59:59
kwi@kwi.dk
AuthSettingsController: rename dictionary key for consistency

Rename 'auth_plugins_shortnames' to 'plugin_shortnames' for consistency
with 'plugin_settings', and to emphasize that it's not one of the values
retrieved from the database using get_auth_settings (all of which start
with 'auth_').
2 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/auth_settings.py
Show inline comments
 
@@ -64,19 +64,19 @@ class AuthSettingsController(BaseControl
 
    def index(self, defaults=None, errors=None, prefix_error=False):
 
        self.__load_defaults()
 
        _defaults = {}
 
        formglobals = {}
 
        formglobals.update(Setting.get_auth_settings())
 
        formglobals["plugin_settings"] = {}
 
        formglobals["auth_plugins_shortnames"] = {}
 
        formglobals["plugin_shortnames"] = {}
 
        _defaults["auth_plugins"] = formglobals["auth_plugins"]
 

	
 
        for module in formglobals["auth_plugins"]:
 
            plugin = auth_modules.loadplugin(module)
 
            plugin_name = plugin.name
 
            formglobals["auth_plugins_shortnames"][module] = plugin_name
 
            formglobals["plugin_shortnames"][module] = plugin_name
 
            formglobals["plugin_settings"][module] = plugin.plugin_settings()
 
            for v in formglobals["plugin_settings"][module]:
 
                fullname = ("auth_" + plugin_name + "_" + v["name"])
 
                if "default" in v:
 
                    _defaults[fullname] = v["default"]
 
                # Current values will be the default on the form, if there are any
kallithea/templates/admin/auth/auth_settings.html
Show inline comments
 
@@ -44,13 +44,13 @@
 
               </ul>
 
           </div>
 
       </div>
 
    </div>
 

	
 
    %for cnt, module in enumerate(c.auth_plugins):
 
        <% pluginName = c.auth_plugins_shortnames[module] %>
 
        <% pluginName = c.plugin_shortnames[module] %>
 
        <h1>${_('Plugin')}: ${pluginName}</h1>
 
        <div class="fields">
 
        ## autoform generation, based on plugin definition from it's settings
 
        %for setting in c.plugin_settings[module]:
 
            <% fullsetting = "auth_%s_%s" % (pluginName, setting["name"]) %>
 
            <% displayname = (setting["formname"] if ("formname" in setting) else setting["name"]) %>
0 comments (0 inline, 0 general)