diff --git a/app.py b/app.py index 03730e3..37aec45 100644 --- a/app.py +++ b/app.py @@ -301,6 +301,12 @@ def delete_account() -> Response: account_id = request.form.get("id") base_url = app.config["BACKEND_URL"] delete_user_account(base_url, session["auth_credentials"], account_id) + # Clear cache for user accounts route + cache.delete(f"view/{session['username']}/accounts") + cache.delete_memoized(user_accounts, key_prefix=make_cache_key) + # Clear home page cache to remove expired account from stats + cache.delete(f"view/{session['username']}/home") + cache.delete_memoized(home, key_prefix=make_cache_key) # Run the NPM config update in a background thread to remove the deleted account's redirect thread = threading.Thread(target=_update_npm_config_in_background, args=(session["auth_credentials"],)) thread.start()