# HG changeset patch # User Martin Bornhold # Date 2016-07-27 13:54:42 # Node ID 82fa7f5f67784ff207230436bad0fc83a4118ced # Parent 8bb872ec7b8e41f464e6ddc811fc99170af56076 auth: Fix renaming of 'auth_cahe_ttl' to 'cache_ttl' #4127 diff --git a/rhodecode/authentication/base.py b/rhodecode/authentication/base.py --- a/rhodecode/authentication/base.py +++ b/rhodecode/authentication/base.py @@ -565,8 +565,8 @@ def authenticate(username, password, env 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) diff --git a/rhodecode/tests/functional/test_admin_auth_settings.py b/rhodecode/tests/functional/test_admin_auth_settings.py --- a/rhodecode/tests/functional/test_admin_auth_settings.py +++ b/rhodecode/tests/functional/test_admin_auth_settings.py @@ -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, } ) diff --git a/rhodecode/tests/other/vcs_operations/conftest.py b/rhodecode/tests/other/vcs_operations/conftest.py --- a/rhodecode/tests/other/vcs_operations/conftest.py +++ b/rhodecode/tests/other/vcs_operations/conftest.py @@ -217,10 +217,10 @@ def enable_auth_plugins(request, pylonsa 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