1
0
forked from ScoDoc/ScoDoc

invalidate local (request) nt cache

This commit is contained in:
Emmanuel Viennet 2021-07-27 20:36:10 +03:00
parent f00a18aeb7
commit 18b802130a
2 changed files with 7 additions and 3 deletions

View File

@ -1 +1 @@
8.0.2 8.0.3

View File

@ -260,11 +260,15 @@ def invalidate_formsemestre( # was inval_cache( context, formsemestre_id=None,
# Delete cached notes and evaluations # Delete cached notes and evaluations
NotesTableCache.delete_many(formsemestre_ids) NotesTableCache.delete_many(formsemestre_ids)
if formsemestre_id: if formsemestre_id:
for formsemestre_id in formsemestre_ids: for fid in formsemestre_ids:
EvaluationCache.invalidate_sem(formsemestre_id) EvaluationCache.invalidate_sem(fid)
if hasattr(g, "nt_cache") and fid in g.nt_cache:
del g.nt_cache[fid]
else: else:
# optimization when we invalidate all evaluations: # optimization when we invalidate all evaluations:
EvaluationCache.invalidate_all_sems() EvaluationCache.invalidate_all_sems()
if hasattr(g, "nt_cache"):
del g.nt_cache
SemInscriptionsCache.delete_many(formsemestre_ids) SemInscriptionsCache.delete_many(formsemestre_ids)
SemBulletinsPDFCache.invalidate_sems(formsemestre_ids) SemBulletinsPDFCache.invalidate_sems(formsemestre_ids)