From 055dcfea36cf7d69f911974d8b0f4a97f8317acf Mon Sep 17 00:00:00 2001
From: Emmanuel Viennet Bulletins non publiés sur le portail Formation ')
- if Se.sem["gestion_semestrielle"] == "1":
+ if Se.sem["gestion_semestrielle"]:
H.append("avec semestres décalés' % rowstyle
)
@@ -492,7 +492,7 @@ def _bulletin_pdf_table_legacy(context, I, version="long"):
if version != "short":
# --- notes de chaque eval:
for e in mod["evaluations"]:
- if int(e["visibulletin"]) == 1 or version == "long":
+ if e["visibulletin"] or version == "long":
S.newline(ue_type=ue_type)
t = ["", "", e["name"], e["note_txt"], e["coef_txt"]]
if bul_show_abs_modules:
diff --git a/app/scodoc/sco_bulletins_standard.py b/app/scodoc/sco_bulletins_standard.py
index d77b91a95..c95e3ffd9 100644
--- a/app/scodoc/sco_bulletins_standard.py
+++ b/app/scodoc/sco_bulletins_standard.py
@@ -647,7 +647,7 @@ class BulletinGeneratorStandard(sco_bulletins_generator.BulletinGenerator):
# --- notes de chaque eval:
nbeval = 0
for e in evals:
- if int(e["visibulletin"]) == 1 or self.version == "long":
+ if e["visibulletin"] or self.version == "long":
if nbeval == 0:
eval_style = " b_eval_first"
else:
diff --git a/app/scodoc/sco_bulletins_xml.py b/app/scodoc/sco_bulletins_xml.py
index bfdcc238f..23b06aeee 100644
--- a/app/scodoc/sco_bulletins_xml.py
+++ b/app/scodoc/sco_bulletins_xml.py
@@ -82,7 +82,7 @@ def make_xml_formsemestre_bulletinetud(
REQUEST.RESPONSE.setHeader("content-type", scu.XML_MIMETYPE)
sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
- if sem["bul_hide_xml"] == "0" or force_publishing:
+ if (not sem["bul_hide_xml"]) or force_publishing:
published = "1"
else:
published = "0"
@@ -270,7 +270,7 @@ def make_xml_formsemestre_bulletinetud(
evals = nt.get_evals_in_mod(modimpl["moduleimpl_id"])
if version != "short":
for e in evals:
- if int(e["visibulletin"]) == 1 or version == "long":
+ if e["visibulletin"] or version == "long":
x_eval = Element(
"evaluation",
jour=ndb.DateDMYtoISO(e["jour"], null_is_empty=True),
diff --git a/app/scodoc/sco_compute_moy.py b/app/scodoc/sco_compute_moy.py
index 8124671e8..0a891b104 100644
--- a/app/scodoc/sco_compute_moy.py
+++ b/app/scodoc/sco_compute_moy.py
@@ -290,7 +290,7 @@ def do_moduleimpl_moyennes(context, nt, mod):
sum_coefs += e["coefficient"]
else:
# il manque une note ! (si publish_incomplete, cela peut arriver, on ignore)
- if e["coefficient"] > 0 and e["publish_incomplete"] == "0":
+ if e["coefficient"] > 0 and not e["publish_incomplete"]:
nb_missing += 1
if nb_missing == 0 and sum_coefs > 0:
if sum_coefs > 0:
diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py
index 5a0b4f0de..6c14b8a4f 100644
--- a/app/scodoc/sco_edit_ue.py
+++ b/app/scodoc/sco_edit_ue.py
@@ -72,7 +72,10 @@ _ueEditor = ndb.EditableTable(
"coefficient",
),
sortkey="numero",
- input_formators={"type": ndb.int_null_is_zero},
+ input_formators={
+ "type": ndb.int_null_is_zero,
+ "is_external": bool,
+ },
output_formators={
"numero": ndb.int_null_is_zero,
"ects": ndb.float_null_is_null,
diff --git a/app/scodoc/sco_entreprises.py b/app/scodoc/sco_entreprises.py
index d601f4e16..02b4f3368 100644
--- a/app/scodoc/sco_entreprises.py
+++ b/app/scodoc/sco_entreprises.py
@@ -149,7 +149,10 @@ _entreprisesEditor = EntreprisesEditor(
"date_creation",
),
sortkey="nom",
- input_formators={"nom": _format_nom},
+ input_formators={
+ "nom": _format_nom,
+ "plus10salaries": bool,
+ },
)
# ----------- Correspondants
diff --git a/app/scodoc/sco_etud.py b/app/scodoc/sco_etud.py
index ba7a275b0..bc19789fa 100644
--- a/app/scodoc/sco_etud.py
+++ b/app/scodoc/sco_etud.py
@@ -264,6 +264,7 @@ _identiteEditor = ndb.EditableTable(
"prenom": force_uppercase,
"civilite": input_civilite,
"date_naissance": ndb.DateDMYtoISO,
+ "boursier": bool,
},
output_formators={"date_naissance": ndb.DateISOtoDMY},
convert_null_outputs_to_empty=True,
diff --git a/app/scodoc/sco_evaluations.py b/app/scodoc/sco_evaluations.py
index 60cf0e648..5831209cd 100644
--- a/app/scodoc/sco_evaluations.py
+++ b/app/scodoc/sco_evaluations.py
@@ -115,8 +115,6 @@ _evaluationEditor = ndb.EditableTable(
sortkey="numero desc, jour desc, heure_debut desc", # plus recente d'abord
output_formators={
"jour": ndb.DateISOtoDMY,
- "visibulletin": bool,
- "publish_incomplete": bool,
"numero": ndb.int_null_is_zero,
},
input_formators={
@@ -125,6 +123,7 @@ _evaluationEditor = ndb.EditableTable(
"heure_fin": ndb.TimetoISO8601, # converti par do_evaluation_list
"visibulletin": bool,
"publish_incomplete": bool,
+ "evaluation_type": int,
},
)
@@ -494,14 +493,14 @@ def do_evaluation_etat(evaluation_id, partition_id=None, select_first_partition=
complete = True
if (
TotalNbMissing > 0
- and (TotalNbMissing == TotalNbAtt or E["publish_incomplete"] != "0")
+ and ((TotalNbMissing == TotalNbAtt) or E["publish_incomplete"])
and not is_malus
):
evalattente = True
else:
evalattente = False
# mais ne met pas en attente les evals immediates sans aucune notes:
- if E["publish_incomplete"] != "0" and nb_notes == 0:
+ if E["publish_incomplete"] and nb_notes == 0:
evalattente = False
# Calcul moyenne dans chaque groupe de TD
@@ -1235,8 +1234,8 @@ def evaluation_create_form(
heures = ["%02dh%02d" % (h, m) for h in range(8, 19) for m in (0, 30)]
#
- initvalues["visibulletin"] = initvalues.get("visibulletin", "1")
- if initvalues["visibulletin"] == "1":
+ initvalues["visibulletin"] = initvalues.get("visibulletin", True)
+ if initvalues["visibulletin"]:
initvalues["visibulletinlist"] = ["X"]
else:
initvalues["visibulletinlist"] = []
@@ -1372,9 +1371,9 @@ def evaluation_create_form(
else:
# form submission
if tf[2]["visibulletinlist"]:
- tf[2]["visibulletin"] = 1
+ tf[2]["visibulletin"] = True
else:
- tf[2]["visibulletin"] = 0
+ tf[2]["visibulletin"] = False
if not edit:
# creation d'une evaluation
evaluation_id = do_evaluation_create(REQUEST=REQUEST, **tf[2])
diff --git a/app/scodoc/sco_find_etud.py b/app/scodoc/sco_find_etud.py
index 4efbae7cb..9176fda01 100644
--- a/app/scodoc/sco_find_etud.py
+++ b/app/scodoc/sco_find_etud.py
@@ -106,8 +106,13 @@ def search_etud_in_dept(context, expnom="", REQUEST=None):
expnom: string, regexp sur le nom ou un code_nip ou un etudid
"""
if len(expnom) > 1:
- etuds = sco_etud.get_etud_info(filled=1, etudid=expnom, REQUEST=REQUEST)
- if len(etuds) != 1:
+ try:
+ etudid = int(expnom)
+ except ValueError:
+ etudid = None
+ if etudid is not None:
+ etuds = sco_etud.get_etud_info(filled=1, etudid=expnom, REQUEST=REQUEST)
+ if (etudid is None) or len(etuds) != 1:
if scu.is_valid_code_nip(expnom):
etuds = search_etuds_infos(code_nip=expnom)
else:
diff --git a/app/scodoc/sco_formsemestre.py b/app/scodoc/sco_formsemestre.py
index 96cce806e..5a71da4eb 100644
--- a/app/scodoc/sco_formsemestre.py
+++ b/app/scodoc/sco_formsemestre.py
@@ -69,18 +69,19 @@ _formsemestreEditor = ndb.EditableTable(
output_formators={
"date_debut": ndb.DateISOtoDMY,
"date_fin": ndb.DateISOtoDMY,
- "gestion_compensation": bool,
- "gestion_semestrielle": bool,
- "etat": bool,
- "bul_hide_xml": bool,
},
input_formators={
"date_debut": ndb.DateDMYtoISO,
"date_fin": ndb.DateDMYtoISO,
+ "etat": bool,
+ "gestion_compensation": bool,
+ "bul_hide_xml": bool,
+ "gestion_semestrielle": bool,
"gestion_compensation": bool,
"gestion_semestrielle": bool,
- "etat": bool,
- "bul_hide_xml": bool,
+ "resp_can_edit": bool,
+ "resp_can_change_ens": bool,
+ "ens_can_edit_eval": bool,
},
)
diff --git a/app/scodoc/sco_formsemestre_edit.py b/app/scodoc/sco_formsemestre_edit.py
index 1e502e2a1..50d964151 100644
--- a/app/scodoc/sco_formsemestre_edit.py
+++ b/app/scodoc/sco_formsemestre_edit.py
@@ -29,6 +29,7 @@
"""
import flask
from flask import url_for, g
+from flask_login import current_user
from app.auth.models import User
import app.scodoc.notesdb as ndb
@@ -124,9 +125,8 @@ def formsemestre_editwithmodules(context, REQUEST, formsemestre_id):
def can_edit_sem(context, REQUEST, formsemestre_id="", sem=None):
"""Return sem if user can edit it, False otherwise"""
sem = sem or sco_formsemestre.get_formsemestre(context, formsemestre_id)
- authuser = REQUEST.AUTHENTICATED_USER
- if not authuser.has_permission(Permission.ScoImplement): # pas chef
- if not sem["resp_can_edit"] or str(authuser) not in sem["responsables"]:
+ if not current_user.has_permission(Permission.ScoImplement): # pas chef
+ if not sem["resp_can_edit"] or current_user.id not in sem["responsables"]:
return False
return sem
@@ -137,23 +137,22 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
if edit:
formsemestre_id = REQUEST.form["formsemestre_id"]
sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
- authuser = REQUEST.AUTHENTICATED_USER
- if not authuser.has_permission(Permission.ScoImplement):
+ if not current_user.has_permission(Permission.ScoImplement):
if not edit:
# il faut ScoImplement pour creer un semestre
raise AccessDenied("vous n'avez pas le droit d'effectuer cette opération")
else:
- if not sem["resp_can_edit"] or str(authuser) not in sem["responsables"]:
+ if not sem["resp_can_edit"] or current_user.id not in sem["responsables"]:
raise AccessDenied(
"vous n'avez pas le droit d'effectuer cette opération"
)
# Liste des enseignants avec forme pour affichage / saisie avec suggestion
userlist = sco_users.get_user_list()
- login2display = {} # user_name : forme pour affichage = "NOM Prenom (login)"
+ uid2display = {} # user_name : forme pour affichage = "NOM Prenom (login)"
for u in userlist:
- login2display[u.user_name] = u.get_nomplogin()
- allowed_user_names = list(login2display.values()) + [""]
+ uid2display[u.id] = u.get_nomplogin()
+ allowed_user_names = list(uid2display.values()) + [""]
#
formation_id = REQUEST.form["formation_id"]
F = sco_formations.formation_list(context, args={"formation_id": formation_id})
@@ -168,29 +167,22 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
# setup form init values
initvalues = sem
semestre_id = initvalues["semestre_id"]
- # initvalues['inscrire_etuds'] = initvalues.get('inscrire_etuds','1')
- # if initvalues['inscrire_etuds'] == '1':
- # initvalues['inscrire_etudslist'] = ['X']
- # else:
- # initvalues['inscrire_etudslist'] = []
- # if REQUEST.form.get('tf-submitted',False) and not REQUEST.form.has_key('inscrire_etudslist'):
- # REQUEST.form['inscrire_etudslist'] = []
- # add associated modules to tf-checked
+ # add associated modules to tf-checked:
ams = sco_moduleimpl.do_moduleimpl_list(
context, formsemestre_id=formsemestre_id
)
sem_module_ids = set([x["module_id"] for x in ams])
- initvalues["tf-checked"] = [x["module_id"] for x in ams]
+ initvalues["tf-checked"] = ["MI" + str(x["module_id"]) for x in ams]
for x in ams:
- initvalues[str(x["module_id"])] = login2display.get(
+ initvalues["MI" + str(x["module_id"])] = uid2display.get(
x["responsable_id"], x["responsable_id"]
)
- initvalues["responsable_id"] = login2display.get(
+ initvalues["responsable_id"] = uid2display.get(
sem["responsables"][0], sem["responsables"][0]
)
if len(sem["responsables"]) > 1:
- initvalues["responsable_id2"] = login2display.get(
+ initvalues["responsable_id2"] = uid2display.get(
sem["responsables"][1], sem["responsables"][1]
)
@@ -200,13 +192,13 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
NB_SEM = parcours.NB_SEM
else:
NB_SEM = 10 # fallback, max 10 semestres
- semestre_id_list = ["-1"] + [str(x) for x in range(1, NB_SEM + 1)]
+ semestre_id_list = [-1] + list(range(1, NB_SEM + 1))
semestre_id_labels = []
for sid in semestre_id_list:
if sid == "-1":
semestre_id_labels.append("pas de semestres")
else:
- semestre_id_labels.append(sid)
+ semestre_id_labels.append(str(sid))
# Liste des modules dans ce semestre de cette formation
# on pourrait faire un simple module_list( )
# mais si on veut l'ordre du PPN (groupe par UE et matieres) il faut:
@@ -464,7 +456,7 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
},
),
]
- if authuser.has_permission(Permission.ScoImplement):
+ if current_user.has_permission(Permission.ScoImplement):
modform += [
(
"resp_can_edit",
@@ -627,8 +619,8 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
initvalues["vdi_apo" + str(n)] = etape_vdi.vdi
n += 1
#
- initvalues["gestion_compensation"] = initvalues.get("gestion_compensation", "0")
- if initvalues["gestion_compensation"] == "1":
+ initvalues["gestion_compensation"] = initvalues.get("gestion_compensation", False)
+ if initvalues["gestion_compensation"]:
initvalues["gestion_compensation_lst"] = ["X"]
else:
initvalues["gestion_compensation_lst"] = []
@@ -638,8 +630,8 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
):
REQUEST.form["gestion_compensation_lst"] = []
- initvalues["gestion_semestrielle"] = initvalues.get("gestion_semestrielle", "0")
- if initvalues["gestion_semestrielle"] == "1":
+ initvalues["gestion_semestrielle"] = initvalues.get("gestion_semestrielle", False)
+ if initvalues["gestion_semestrielle"]:
initvalues["gestion_semestrielle_lst"] = ["X"]
else:
initvalues["gestion_semestrielle_lst"] = []
@@ -649,8 +641,8 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
):
REQUEST.form["gestion_semestrielle_lst"] = []
- initvalues["bul_hide_xml"] = initvalues.get("bul_hide_xml", "0")
- if initvalues["bul_hide_xml"] == "0":
+ initvalues["bul_hide_xml"] = initvalues.get("bul_hide_xml", False)
+ if not initvalues["bul_hide_xml"]:
initvalues["bul_publish_xml_lst"] = ["X"]
else:
initvalues["bul_publish_xml_lst"] = []
@@ -691,23 +683,23 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
return " """
)
H.append("")
- if sem["bul_hide_xml"] != "0":
+ if sem["bul_hide_xml"]:
H.append(
'annulation
"
else:
if tf[2]["gestion_compensation_lst"]:
- tf[2]["gestion_compensation"] = 1
+ tf[2]["gestion_compensation"] = True
else:
- tf[2]["gestion_compensation"] = 0
+ tf[2]["gestion_compensation"] = False
if tf[2]["gestion_semestrielle_lst"]:
- tf[2]["gestion_semestrielle"] = 1
+ tf[2]["gestion_semestrielle"] = True
else:
- tf[2]["gestion_semestrielle"] = 0
+ tf[2]["gestion_semestrielle"] = False
if tf[2]["bul_publish_xml_lst"]:
- tf[2]["bul_hide_xml"] = 0
+ tf[2]["bul_hide_xml"] = False
else:
- tf[2]["bul_hide_xml"] = 1
+ tf[2]["bul_hide_xml"] = True
# remap les identifiants de responsables:
- tf[2]["responsable_id"] = User.get_user_name_from_nomplogin(
+ tf[2]["responsable_id"] = User.get_user_id_from_nomplogin(
tf[2]["responsable_id"]
)
- tf[2]["responsable_id2"] = User.get_user_name_from_nomplogin(
+ tf[2]["responsable_id2"] = User.get_user_id_from_nomplogin(
tf[2]["responsable_id2"]
)
tf[2]["responsables"] = [tf[2]["responsable_id"]]
@@ -715,7 +707,7 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
tf[2]["responsables"].append(tf[2]["responsable_id2"])
for module_id in tf[2]["tf-checked"]:
- mod_resp_id = User.get_user_name_from_nomplogin(tf[2][module_id])
+ mod_resp_id = User.get_user_id_from_nomplogin(tf[2][module_id])
if mod_resp_id is None:
# Si un module n'a pas de responsable (ou inconnu), l'affecte au 1er directeur des etudes:
mod_resp_id = tf[2]["responsable_id"]
@@ -774,7 +766,7 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
modargs = {
"module_id": module_id,
"formsemestre_id": formsemestre_id,
- "responsable_id": tf[2][module_id],
+ "responsable_id": tf[2]["MI" + str(module_id)],
}
moduleimpl_id = sco_moduleimpl.do_moduleimpl_create(context, modargs)
mod = sco_edit_module.do_module_list(context, {"module_id": module_id})[
@@ -825,7 +817,7 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
"moduleimpl_id": moduleimpl_id,
"module_id": module_id,
"formsemestre_id": formsemestre_id,
- "responsable_id": tf[2][module_id],
+ "responsable_id": tf[2]["MI" + str(module_id)],
}
sco_moduleimpl.do_moduleimpl_edit(
context, modargs, formsemestre_id=formsemestre_id
@@ -893,14 +885,14 @@ def formsemestre_clone(context, formsemestre_id, REQUEST=None):
sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
# Liste des enseignants avec forme pour affichage / saisie avec suggestion
userlist = sco_users.get_user_list()
- login2display = {} # user_name : forme pour affichage = "NOM Prenom (login)"
+ uid2display = {} # user_name : forme pour affichage = "NOM Prenom (login)"
for u in userlist:
- login2display[u.user_name] = u.get_nomplogin()
- allowed_user_names = list(login2display.values()) + [""]
+ uid2display[u.id] = u.get_nomplogin()
+ allowed_user_names = list(uid2display.values()) + [""]
initvalues = {
"formsemestre_id": sem["formsemestre_id"],
- "responsable_id": login2display.get(
+ "responsable_id": uid2display.get(
sem["responsables"][0], sem["responsables"][0]
),
}
@@ -1001,7 +993,7 @@ def formsemestre_clone(context, formsemestre_id, REQUEST=None):
new_formsemestre_id = do_formsemestre_clone(
context,
formsemestre_id,
- User.get_user_name_from_nomplogin(tf[2]["responsable_id"]),
+ User.get_user_id_from_nomplogin(tf[2]["responsable_id"]),
tf[2]["date_debut"],
tf[2]["date_fin"],
clone_evaluations=tf[2]["clone_evaluations"],
@@ -1523,7 +1515,7 @@ def formsemestre_change_publication_bul(
if not ok:
return err
sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
- etat = 1 - int(sem["bul_hide_xml"])
+ etat = not sem["bul_hide_xml"]
if REQUEST and not dialog_confirmed:
if etat:
@@ -1542,10 +1534,6 @@ def formsemestre_change_publication_bul(
parameters={"bul_hide_xml": etat, "formsemestre_id": formsemestre_id},
)
- if etat not in (0, 1):
- raise ScoValueError(
- "formsemestre_change_publication_bul: invalid value for etat (%s)" % etat
- )
args = {"formsemestre_id": formsemestre_id, "bul_hide_xml": etat}
sco_formsemestre.do_formsemestre_edit(context, args)
if REQUEST:
diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py
index 7d688087a..0780102a7 100644
--- a/app/scodoc/sco_formsemestre_status.py
+++ b/app/scodoc/sco_formsemestre_status.py
@@ -550,7 +550,7 @@ def fill_formsemestre(sem):
else:
sem["locklink"] = ""
if sco_preferences.get_preference("bul_display_publication", formsemestre_id):
- if sem["bul_hide_xml"] != "0":
+ if sem["bul_hide_xml"]:
eyeicon = scu.icontag("hide_img", border="0", title="Bulletins NON publiés")
else:
eyeicon = scu.icontag("eye_img", border="0", title="Bulletins publiés")
@@ -672,7 +672,7 @@ def formsemestre_description_table(
e["evalcomplete_str"] = "Non"
e["_evalcomplete_str_td_attrs"] = 'style="color: red;"'
- if int(e["publish_incomplete"]):
+ if e["publish_incomplete"]:
e["publish_incomplete_str"] = "Oui"
e["_publish_incomplete_str_td_attrs"] = 'style="color: green;"'
else:
@@ -969,7 +969,7 @@ Il y a des notes en attente ! Le classement des étudiants n'a qu'une valeur ind
L'étudiant pense pouvoir justifier cette absence.
Vérifiez le justificatif avant d'enregistrer.
Pour ajouter un enseignant, choisissez un nom dans le menu
' @@ -838,7 +839,7 @@ def edit_moduleimpl_resp(context, REQUEST, moduleimpl_id): elif tf[0] == -1: return flask.redirect("moduleimpl_status?moduleimpl_id=" + moduleimpl_id) else: - responsable_id = User.get_user_name_from_nomplogin(tf[2]["responsable_id"]) + responsable_id = User.get_user_id_from_nomplogin(tf[2]["responsable_id"]) if ( not responsable_id ): # presque impossible: tf verifie les valeurs (mais qui peuvent changer entre temps) diff --git a/app/views/scolar.py b/app/views/scolar.py index da00ace6e..725573ee6 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -703,6 +703,18 @@ sco_publish( Permission.ScoView, methods=["GET", "POST"], ) +# @bp.route("/partition_create", methods=["GET", "POST"]) +# @permission_required(Permission.ScoView) +# @scodoc7func(context) +# def partition_create( +# context, +# formsemestre_id, +# partition_name="", +# default=False, +# numero=None, +# redirect=1): +# return sco_groups.partition_create(context, formsemestre_id, + sco_publish("/etud_info_html", sco_page_etud.etud_info_html, Permission.ScoView) diff --git a/scotests/test_deleteBilletAbsence.py b/scotests/test_deleteBilletAbsence.py index db605ae05..c9350cb30 100644 --- a/scotests/test_deleteBilletAbsence.py +++ b/scotests/test_deleteBilletAbsence.py @@ -43,22 +43,29 @@ mi = G.create_moduleimpl( # --- Création d'un étudiant etud = G.create_etud(code_nip=None) G.inscrit_etudiant(sem, etud) -etudid=etud["etudid"] +etudid = etud["etudid"] # --- Création d'une absence -sco_abs_views.doSignaleAbsence(context.Absences, datedebut="22/01/2021", datefin="22/01/2021", demijournee=2, etudid=etudid, REQUEST=REQUEST) +sco_abs_views.doSignaleAbsence( + context.Absences, + datedebut="22/01/2021", + datefin="22/01/2021", + demijournee=2, + etudid=etudid, + REQUEST=REQUEST, +) # --- Création d'un billet b1 = context.Absences.AddBilletAbsence( - begin="2021-01-22 00:00", - end="2021-01-22 23:59", - etudid=etudid, - description = "abs du 22", - justified=False, - code_nip=etuds[0]["code_nip"], - code_ine=etuds[0]["code_ine"], - REQUEST=REQUEST, - ) + begin="2021-01-22 00:00", + end="2021-01-22 23:59", + etudid=etudid, + description="abs du 22", + justified=False, + code_nip=etuds[0]["code_nip"], + code_ine=etuds[0]["code_ine"], + REQUEST=REQUEST, +) # --- Suppression d'un billet _ = context.Absences.deleteBilletAbsence(load_li_bi[1]["billet_id"], REQUEST=REQUEST) diff --git a/tests/unit/test_sco_basic.py b/tests/unit/test_sco_basic.py index 8e0c405be..9817d3ce2 100644 --- a/tests/unit/test_sco_basic.py +++ b/tests/unit/test_sco_basic.py @@ -132,7 +132,7 @@ def run_sco_basic(verbose=False): assert etat["evalcomplete"] # Modifie l'évaluation 2 pour "prise en compte immédiate" - e2["publish_incomplete"] = "1" + e2["publish_incomplete"] = True sco_evaluations.do_evaluation_edit(e2) etat = sco_evaluations.do_evaluation_etat(e2["evaluation_id"]) assert etat["evalcomplete"] == False