auth: Fix renaming of 'auth_cahe_ttl' to 'cache_ttl' #4127
This commit is contained in:
parent
74d0f0c336
commit
bee42a50ed
3 changed files with 8 additions and 8 deletions
|
|
@ -565,8 +565,8 @@ def authenticate(username, password, environ=None, auth_type=None,
|
|||
if isinstance(plugin.AUTH_CACHE_TTL, (int, long)):
|
||||
# plugin cache set inside is more important than the settings value
|
||||
_cache_ttl = plugin.AUTH_CACHE_TTL
|
||||
elif plugin_settings.get('auth_cache_ttl'):
|
||||
_cache_ttl = safe_int(plugin_settings.get('auth_cache_ttl'), 0)
|
||||
elif plugin_settings.get('cache_ttl'):
|
||||
_cache_ttl = safe_int(plugin_settings.get('cache_ttl'), 0)
|
||||
|
||||
plugin_cache_active = bool(_cache_ttl and _cache_ttl > 0)
|
||||
|
||||
|
|
|
|||
|
|
@ -47,10 +47,10 @@ class TestAuthSettingsController(object):
|
|||
for plugin in plugins_list.split(','):
|
||||
plugin_name = plugin.partition('#')[-1]
|
||||
enabled_plugin = '%s_enabled' % plugin_name
|
||||
cache_ttl = '%s_auth_cache_ttl' % plugin_name
|
||||
cache_ttl = '%s_cache_ttl' % plugin_name
|
||||
|
||||
# default params that are needed for each plugin,
|
||||
# `enabled` and `auth_cache_ttl`
|
||||
# `enabled` and `cache_ttl`
|
||||
params.update({
|
||||
enabled_plugin: True,
|
||||
cache_ttl: 0
|
||||
|
|
@ -97,7 +97,7 @@ class TestAuthSettingsController(object):
|
|||
'attr_firstname': 'ima',
|
||||
'attr_lastname': 'tester',
|
||||
'attr_email': 'test@example.com',
|
||||
'auth_cache_ttl': '0',
|
||||
'cache_ttl': '0',
|
||||
})
|
||||
if force:
|
||||
params = {}
|
||||
|
|
@ -190,7 +190,7 @@ class TestAuthSettingsController(object):
|
|||
'attr_firstname': 'ima',
|
||||
'attr_lastname': 'tester',
|
||||
'attr_email': 'test@example.com',
|
||||
'auth_cache_ttl': '60',
|
||||
'cache_ttl': '60',
|
||||
'csrf_token': csrf_token,
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -217,10 +217,10 @@ def enable_auth_plugins(request, pylonsapp, csrf_token):
|
|||
plugin = rhodecode.authentication.base.loadplugin(module)
|
||||
plugin_name = plugin.name
|
||||
enabled_plugin = 'auth_%s_enabled' % plugin_name
|
||||
cache_ttl = 'auth_%s_auth_cache_ttl' % plugin_name
|
||||
cache_ttl = 'auth_%s_cache_ttl' % plugin_name
|
||||
|
||||
# default params that are needed for each plugin,
|
||||
# `enabled` and `auth_cache_ttl`
|
||||
# `enabled` and `cache_ttl`
|
||||
params.update({
|
||||
enabled_plugin: True,
|
||||
cache_ttl: 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue