##// END OF EJS Templates
auth: don't cache settings for auth plugins
marcink -
r2170:4adf3415 default
parent child Browse files
Show More
@@ -208,12 +208,15 b' class RhodeCodeAuthPluginBase(object):'
208 """
208 """
209 return AuthnPluginSettingsSchemaBase()
209 return AuthnPluginSettingsSchemaBase()
210
210
211 def get_setting_by_name(self, name, default=None):
211 def get_setting_by_name(self, name, default=None, cache=True):
212 """
212 """
213 Returns a plugin setting by name.
213 Returns a plugin setting by name.
214 """
214 """
215 full_name = 'rhodecode_{}'.format(self._get_setting_full_name(name))
215 full_name = 'rhodecode_{}'.format(self._get_setting_full_name(name))
216 plugin_settings = self.plugin_settings
216 if cache:
217 plugin_settings = self.plugin_settings
218 else:
219 plugin_settings = SettingsModel().get_all_settings()
217
220
218 return plugin_settings.get(full_name) or default
221 return plugin_settings.get(full_name) or default
219
222
@@ -61,7 +61,7 b' class AuthnPluginViewBase(object):'
61 for node in schema:
61 for node in schema:
62 if node.name not in defaults:
62 if node.name not in defaults:
63 defaults[node.name] = self.plugin.get_setting_by_name(
63 defaults[node.name] = self.plugin.get_setting_by_name(
64 node.name, node.default)
64 node.name, node.default, cache=False)
65
65
66 template_context = {
66 template_context = {
67 'defaults': defaults,
67 'defaults': defaults,
General Comments 0
You need to be logged in to leave comments. Login now