From 8ccfc06671b5600893244ae76a176ca577ba66be Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 23 Aug 2023 16:35:10 +0200 Subject: [PATCH] Fix small bug --- app/scodoc/notesdb.py | 8 +++----- app/scodoc/sco_assiduites.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/scodoc/notesdb.py b/app/scodoc/notesdb.py index 4d9b6aa2a..b9be4ae12 100644 --- a/app/scodoc/notesdb.py +++ b/app/scodoc/notesdb.py @@ -1,19 +1,17 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- +import datetime import html import traceback + +from flask import g, current_app, abort import psycopg2 import psycopg2.pool import psycopg2.extras -from flask import g, current_app, abort - -import app -import app.scodoc.sco_utils as scu from app import log from app.scodoc.sco_exceptions import ScoException, ScoValueError, NoteProcessError -import datetime quote_html = html.escape diff --git a/app/scodoc/sco_assiduites.py b/app/scodoc/sco_assiduites.py index d350ff6d3..f51736634 100644 --- a/app/scodoc/sco_assiduites.py +++ b/app/scodoc/sco_assiduites.py @@ -428,7 +428,7 @@ def invalidate_assiduites_count(etudid, sem): """Invalidate (clear) cached counts""" date_debut = sem["date_debut_iso"] date_fin = sem["date_fin_iso"] - for met in [string.lower() for string in scu.AssiduitesMetricShort.all()]: + for met in scu.AssiduitesMetrics.TAG: key = str(etudid) + "_" + date_debut + "_" + date_fin + f"{met}_assiduites" sco_cache.AbsSemEtudCache.delete(key)