diff --git a/app/scodoc/notesdb.py b/app/scodoc/notesdb.py
index 796f6edf20..f6af848b50 100644
--- a/app/scodoc/notesdb.py
+++ b/app/scodoc/notesdb.py
@@ -171,18 +171,32 @@ def DBSelectArgs(
cl.append("T0.%s = T%d.%s" % (id_name, i, aux_id))
i = i + 1
cond += " and ".join(cl)
- # Traitement des expressions régulières:
- # n'autorise pas d'expressions
- if test == "~":
- for k in vals.keys():
- vals[k] = vals[k].translate(_SQL_REMOVE_BAD_CHARS)
if vals:
if aux_tables: # paren
cond += " AND ( "
- cond += operator.join(
- ["T0.%s%s%%(%s)s" % (x, test, x) for x in vals.keys() if vals[x] != None]
- )
+
+ if test == "~":
+ # Traitement des expressions régulières:
+ # n'autorise pas d'expressions
+ explist = []
+ for k in vals.keys():
+ # n'applique ~ qu'aux strings
+ if isinstance(vals[k], str):
+ vals[k] = vals[k].translate(_SQL_REMOVE_BAD_CHARS)
+ explist.append("T0.%s~%%(%s)s" % (k, k))
+ elif vals[k] is not None:
+ explist.append("T0.%s=%%(%s)s" % (k, k))
+ cond += operator.join(explist)
+ else:
+ cond += operator.join(
+ [
+ "T0.%s%s%%(%s)s" % (x, test, x)
+ for x in vals.keys()
+ if vals[x] != None
+ ]
+ )
+ # conditions sur NULLs:
cnuls = " and ".join(
["T0.%s is NULL" % x for x in vals.keys() if vals[x] is None]
)
diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py
index a60a66cf02..651ea515ed 100644
--- a/app/scodoc/sco_formsemestre_status.py
+++ b/app/scodoc/sco_formsemestre_status.py
@@ -872,8 +872,10 @@ def _make_listes_sem(context, sem, REQUEST=None, with_absences=True):
H.append('
Aucun groupe dans cette partition')
if sco_groups.sco_permissions_check.can_change_groups(formsemestre_id):
H.append(
- ' (créer)'
- % partition["partition_id"]
+ f""" (créer)"""
)
H.append("
'
% (
bulle_pm,
- etudid + ":" + date + ":" + "pm",
+ str(etudid) + ":" + date + ":" + "pm",
checked,
etudid,
date + ":pm",
@@ -820,7 +820,7 @@ def _gen_form_saisie_groupe(
# place la liste des etudiants et les dates pour pouvoir effacer les absences
H.append(
''
- % ",".join([etud["etudid"] for etud in etuds])
+ % ",".join([str(etud["etudid"]) for etud in etuds])
)
H.append('' % dates[0])
H.append('' % dates[-1])