mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 02:17:37 -02:30
Only use in-memory cache for database settings, set ttl=5 (#12166)
* Only use in-memory cache for database settings Make necessary adjustments to monkeypatch as it is very vunerable to recursion Remove migration exception that is now redundant Clear cache if a setting is changed * Use dedicated middleware for setting cache stuff Clear cache for each request * Add tests for in-memory cache
This commit is contained in:
@@ -78,9 +78,10 @@ def oauth2_getattribute(self, attr):
|
||||
# Custom method to override
|
||||
# oauth2_provider.settings.OAuth2ProviderSettings.__getattribute__
|
||||
from django.conf import settings
|
||||
from oauth2_provider.settings import DEFAULTS
|
||||
|
||||
val = None
|
||||
if 'migrate' not in sys.argv:
|
||||
if (isinstance(attr, str)) and (attr in DEFAULTS) and (not attr.startswith('_')):
|
||||
# certain Django OAuth Toolkit migrations actually reference
|
||||
# setting lookups for references to model classes (e.g.,
|
||||
# oauth2_settings.REFRESH_TOKEN_MODEL)
|
||||
|
||||
Reference in New Issue
Block a user