Fixes: #19825 - Prevent cache for config revisions from being overwritten when in debug mode when not intended

This commit is contained in:
Daniel Sheppard 2025-09-01 10:30:57 -05:00
parent 9580ac2946
commit 663f9a223d

View File

@ -42,6 +42,13 @@ class CoreConfig(AppConfig):
# Clear Redis cache on startup in development mode # Clear Redis cache on startup in development mode
if settings.DEBUG: if settings.DEBUG:
try: try:
config = cache.get('config')
config_version = cache.get('config_version')
cache.clear() cache.clear()
if config_version:
# Activate the current config revision
# Do not query DB due to apps still initializing
cache.set('config', config, None)
cache.set('config_version', config_version, None)
except Exception: except Exception:
pass pass