auth: don't cache settings for auth plugins
This commit is contained in:
parent
3d0069b5f4
commit
27697682bc
2 changed files with 6 additions and 3 deletions
|
|
@ -208,12 +208,15 @@ class RhodeCodeAuthPluginBase(object):
|
|||
"""
|
||||
return AuthnPluginSettingsSchemaBase()
|
||||
|
||||
def get_setting_by_name(self, name, default=None):
|
||||
def get_setting_by_name(self, name, default=None, cache=True):
|
||||
"""
|
||||
Returns a plugin setting by name.
|
||||
"""
|
||||
full_name = 'rhodecode_{}'.format(self._get_setting_full_name(name))
|
||||
plugin_settings = self.plugin_settings
|
||||
if cache:
|
||||
plugin_settings = self.plugin_settings
|
||||
else:
|
||||
plugin_settings = SettingsModel().get_all_settings()
|
||||
|
||||
return plugin_settings.get(full_name) or default
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class AuthnPluginViewBase(object):
|
|||
for node in schema:
|
||||
if node.name not in defaults:
|
||||
defaults[node.name] = self.plugin.get_setting_by_name(
|
||||
node.name, node.default)
|
||||
node.name, node.default, cache=False)
|
||||
|
||||
template_context = {
|
||||
'defaults': defaults,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue