diff --git a/admin/admin.py b/admin/admin.py index a196cac4..f534076d 100644 --- a/admin/admin.py +++ b/admin/admin.py @@ -30,7 +30,7 @@ from werkzeug.utils import secure_filename import api -from cache_config import clear_view_cache_keys +from cache_config import clear_api_cache_keys, clear_view_cache_keys from util import get_theme_directories, length_check # Blueprint configuration @@ -177,6 +177,7 @@ def save_settings(settings: Dict[str, Any], flash_msg: str) -> Response: set_theme_loader(app, remove_cache=True) clear_view_cache_keys(all_users=True) + clear_api_cache_keys("admin_save_settings") flash(flash_msg, 'success') return redirect(url_for("admin_bp.index")) diff --git a/cache_config.py b/cache_config.py index e62d2191..e8261415 100644 --- a/cache_config.py +++ b/cache_config.py @@ -51,6 +51,8 @@ # API cache clear configuration. API_CACHE_CLEAR = { + "admin_save_settings": {"type": "global", "endpoints": ["vault_get_publication_terms", + "vault_preservable_formats_lists"]}, "group_create": {"type": "global", "endpoints": ["group_data"]}, "group_update": {"type": "global", "endpoints": ["group_data"]}, "group_delete": {"type": "global", "endpoints": ["group_data"]},