From 18b802130a64bc850500c114ecd3bc04afa9590f Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 27 Jul 2021 20:36:10 +0300 Subject: [PATCH] invalidate local (request) nt cache --- VERSION | 2 +- app/scodoc/sco_cache.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 8b22a322d..215aacb45 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.0.2 +8.0.3 diff --git a/app/scodoc/sco_cache.py b/app/scodoc/sco_cache.py index 61e542400..07b8aabd0 100644 --- a/app/scodoc/sco_cache.py +++ b/app/scodoc/sco_cache.py @@ -260,11 +260,15 @@ def invalidate_formsemestre( # was inval_cache( context, formsemestre_id=None, # Delete cached notes and evaluations NotesTableCache.delete_many(formsemestre_ids) if formsemestre_id: - for formsemestre_id in formsemestre_ids: - EvaluationCache.invalidate_sem(formsemestre_id) + for fid in formsemestre_ids: + EvaluationCache.invalidate_sem(fid) + if hasattr(g, "nt_cache") and fid in g.nt_cache: + del g.nt_cache[fid] else: # optimization when we invalidate all evaluations: EvaluationCache.invalidate_all_sems() + if hasattr(g, "nt_cache"): + del g.nt_cache SemInscriptionsCache.delete_many(formsemestre_ids) SemBulletinsPDFCache.invalidate_sems(formsemestre_ids)