diff --git a/app/but/bulletin_but_court_pdf.py b/app/but/bulletin_but_court_pdf.py
index e8a6563df..62bba9988 100644
--- a/app/but/bulletin_but_court_pdf.py
+++ b/app/but/bulletin_but_court_pdf.py
@@ -31,6 +31,7 @@ from app.scodoc.sco_bulletins_standard import BulletinGeneratorStandard
from app.scodoc.sco_logos import Logo
from app.scodoc.sco_pdf import PDFLOCK, SU
from app.scodoc.sco_preferences import SemPreferences
+from app.scodoc import sco_utils as scu
def make_bulletin_but_court_pdf(
@@ -343,9 +344,11 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard):
for mod in self.bul[mod_type]:
row = [mod, bul[mod_type][mod]["titre"]]
row += [
- bul["ues"][ue][mod_type][mod]["moyenne"]
- if mod in bul["ues"][ue][mod_type]
- else ""
+ (
+ bul["ues"][ue][mod_type][mod]["moyenne"]
+ if mod in bul["ues"][ue][mod_type]
+ else ""
+ )
for ue in self.ues_acronyms
]
rows.append(row)
@@ -523,7 +526,7 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard):
if self.bul["semestre"].get("decision_annee", None):
txt += f"""
Décision saisie le {
- datetime.datetime.fromisoformat(self.bul["semestre"]["decision_annee"]["date"]).strftime("%d/%m/%Y")
+ datetime.datetime.fromisoformat(self.bul["semestre"]["decision_annee"]["date"]).strftime(scu.DATE_FMT)
}, année BUT{self.bul["semestre"]["decision_annee"]["ordre"]}
{self.bul["semestre"]["decision_annee"]["code"]}.
diff --git a/app/but/bulletin_but_pdf.py b/app/but/bulletin_but_pdf.py
index 999846f77..ef1f1e41f 100644
--- a/app/but/bulletin_but_pdf.py
+++ b/app/but/bulletin_but_pdf.py
@@ -269,7 +269,7 @@ class BulletinGeneratorStandardBUT(BulletinGeneratorStandard):
date_capitalisation = ue.get("date_capitalisation")
if date_capitalisation:
fields_bmr.append(
- f"""Capitalisée le {date_capitalisation.strftime("%d/%m/%Y")}"""
+ f"""Capitalisée le {date_capitalisation.strftime(scu.DATE_FMT)}"""
)
t = {
"titre": " - ".join(fields_bmr),
diff --git a/app/but/jury_but_view.py b/app/but/jury_but_view.py
index 1f2a8a170..2abbeb1d8 100644
--- a/app/but/jury_but_view.py
+++ b/app/but/jury_but_view.py
@@ -21,8 +21,6 @@ from app.but.jury_but import (
DecisionsProposeesRCUE,
DecisionsProposeesUE,
)
-from app.comp import res_sem
-from app.comp.res_but import ResultatsSemestreBUT
from app.models import (
ApcNiveau,
FormSemestre,
@@ -33,11 +31,8 @@ from app.models import (
ScolarFormSemestreValidation,
ScolarNews,
)
-from app.models.config import ScoDocSiteConfig
-from app.scodoc import html_sco_header
from app.scodoc import codes_cursus as sco_codes
from app.scodoc.sco_exceptions import ScoValueError
-from app.scodoc import sco_preferences
from app.scodoc import sco_utils as scu
@@ -217,7 +212,7 @@ def _gen_but_niveau_ue(
scoplement = f"""
{ - appreciation.date.strftime("%d/%m/%y") if appreciation.date else "" + appreciation.date.strftime(scu.DATE_FMT) if appreciation.date else "" } {appreciation.comment_safe()} {mlink} diff --git a/app/scodoc/sco_bulletins_standard.py b/app/scodoc/sco_bulletins_standard.py index f2309e941..f96730b54 100644 --- a/app/scodoc/sco_bulletins_standard.py +++ b/app/scodoc/sco_bulletins_standard.py @@ -182,7 +182,7 @@ class BulletinGeneratorStandard(sco_bulletins_generator.BulletinGenerator): H.append( f"""
{ - appreciation.date.strftime("%d/%m/%Y") + appreciation.date.strftime(scu.DATE_FMT) if appreciation.date else ""} {appreciation.comment_safe()} {mlink} diff --git a/app/scodoc/sco_cal.py b/app/scodoc/sco_cal.py index 3ca918ffe..abb837403 100644 --- a/app/scodoc/sco_cal.py +++ b/app/scodoc/sco_cal.py @@ -29,7 +29,6 @@ """ import calendar -import datetime import html import time @@ -357,7 +356,7 @@ def MonthTableBody( if not halfday: for d in range(1, nbdays + 1): weeknum = time.strftime( - "%U", time.strptime("%d/%d/%d" % (d, month, year), "%d/%m/%Y") + "%U", time.strptime("%d/%d/%d" % (d, month, year), scu.DATE_FMT) ) day = DAYNAMES_ABREV[(firstday + d - 1) % 7] if day in weekend: @@ -432,7 +431,7 @@ def MonthTableBody( # Calendar with 2 cells / day for d in range(1, nbdays + 1): weeknum = time.strftime( - "%U", time.strptime("%d/%d/%d" % (d, month, year), "%d/%m/%Y") + "%U", time.strptime("%d/%d/%d" % (d, month, year), scu.DATE_FMT) ) day = DAYNAMES_ABREV[(firstday + d - 1) % 7] if day in weekend: diff --git a/app/scodoc/sco_edt_cal.py b/app/scodoc/sco_edt_cal.py index b8cdf9ac9..1fce5d269 100644 --- a/app/scodoc/sco_edt_cal.py +++ b/app/scodoc/sco_edt_cal.py @@ -478,11 +478,11 @@ def convert_ics( "heure_deb": event.decoded("dtstart") .replace(tzinfo=timezone.utc) .astimezone(tz=None) - .strftime("%H:%M"), + .strftime(scu.TIME_FMT), "heure_fin": event.decoded("dtend") .replace(tzinfo=timezone.utc) .astimezone(tz=None) - .strftime("%H:%M"), + .strftime(scu.TIME_FMT), "jour": event.decoded("dtstart").date().isoformat(), "start": event.decoded("dtstart").isoformat(), "end": event.decoded("dtend").isoformat(), diff --git a/app/scodoc/sco_etape_apogee_view.py b/app/scodoc/sco_etape_apogee_view.py index f680775c3..f6b38b37f 100644 --- a/app/scodoc/sco_etape_apogee_view.py +++ b/app/scodoc/sco_etape_apogee_view.py @@ -452,7 +452,7 @@ def table_apo_csv_list(semset): apo_data = sco_apogee_csv.ApoData(csv_data, periode=semset["sem_id"]) t["filename"] = apo_data.apo_csv.titles["apoC_Fichier_Exp"] t["nb_etuds"] = len(apo_data.etuds) - t["date_str"] = t["date"].strftime("%d/%m/%Y à %H:%M") + t["date_str"] = t["date"].strftime(scu.DATEATIME_FMT) view_link = url_for( "notes.view_apo_csv", scodoc_dept=g.scodoc_dept, diff --git a/app/scodoc/sco_evaluation_check_abs.py b/app/scodoc/sco_evaluation_check_abs.py index 0349e8f54..852309abc 100644 --- a/app/scodoc/sco_evaluation_check_abs.py +++ b/app/scodoc/sco_evaluation_check_abs.py @@ -135,7 +135,7 @@ def evaluation_check_absences_html( f"""