From 057832c30968ec195b21fea44d14dca99adaadba Mon Sep 17 00:00:00 2001
From: Emmanuel Viennet
"""
+ f"""Paramétrage
"""
)
return "".join(H)
@@ -96,11 +91,12 @@ def sidebar():
"""
]
# ---- Il y-a-t-il un etudiant selectionné ?
- etudid = None
- if request.method == "GET":
- etudid = request.args.get("etudid", None)
- elif request.method == "POST":
- etudid = request.form.get("etudid", None)
+ etudid = g.get("etudid", None)
+ if not etudid:
+ if request.method == "GET":
+ etudid = request.args.get("etudid", None)
+ elif request.method == "POST":
+ etudid = request.form.get("etudid", None)
if etudid:
etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
diff --git a/app/scodoc/sco_archives.py b/app/scodoc/sco_archives.py
index 9cdb7b4e9..578eeb8d5 100644
--- a/app/scodoc/sco_archives.py
+++ b/app/scodoc/sco_archives.py
@@ -272,7 +272,6 @@ PVArchive = SemsArchiver()
def do_formsemestre_archive(
- REQUEST,
formsemestre_id,
group_ids=[], # si indiqué, ne prend que ces groupes
description="",
@@ -340,14 +339,12 @@ def do_formsemestre_archive(
data = data.encode(scu.SCO_ENCODING)
PVArchive.store(archive_id, "Bulletins.xml", data)
# Decisions de jury, en XLS
- data = sco_pvjury.formsemestre_pvjury(
- formsemestre_id, format="xls", REQUEST=REQUEST, publish=False
- )
+ data = sco_pvjury.formsemestre_pvjury(formsemestre_id, format="xls", publish=False)
if data:
PVArchive.store(archive_id, "Decisions_Jury" + scu.XLSX_SUFFIX, data)
# Classeur bulletins (PDF)
data, _ = sco_bulletins_pdf.get_formsemestre_bulletins_pdf(
- formsemestre_id, REQUEST, version=bulVersion
+ formsemestre_id, version=bulVersion
)
if data:
PVArchive.store(archive_id, "Bulletins.pdf", data)
@@ -378,7 +375,7 @@ def do_formsemestre_archive(
PVArchive.store(archive_id, "PV_Jury%s.pdf" % groups_filename, data)
-def formsemestre_archive(REQUEST, formsemestre_id, group_ids=[]):
+def formsemestre_archive(formsemestre_id, group_ids=[]):
"""Make and store new archive for this formsemestre.
(all students or only selected groups)
"""
@@ -456,7 +453,7 @@ enregistrés et non modifiables, on peut les retrouver ultérieurement.
tf = TrivialFormulator(
request.base_url,
- REQUEST.form,
+ request.form if request.method == "POST" else request.args,
descr,
cancelbutton="Annuler",
method="POST",
@@ -478,7 +475,6 @@ enregistrés et non modifiables, on peut les retrouver ultérieurement.
else:
tf[2]["anonymous"] = False
do_formsemestre_archive(
- REQUEST,
formsemestre_id,
group_ids=group_ids,
description=tf[2]["description"],
@@ -502,7 +498,7 @@ enregistrés et non modifiables, on peut les retrouver ultérieurement.
)
-def formsemestre_list_archives(REQUEST, formsemestre_id):
+def formsemestre_list_archives(formsemestre_id):
"""Page listing archives"""
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
sem_archive_id = formsemestre_id
@@ -552,9 +548,7 @@ def formsemestre_get_archived_file(formsemestre_id, archive_name, filename):
return PVArchive.get_archived_file(sem_archive_id, archive_name, filename)
-def formsemestre_delete_archive(
- REQUEST, formsemestre_id, archive_name, dialog_confirmed=False
-):
+def formsemestre_delete_archive(formsemestre_id, archive_name, dialog_confirmed=False):
"""Delete an archive"""
if not sco_permissions_check.can_edit_pv(formsemestre_id):
raise AccessDenied("opération non autorisée pour %s" % str(current_user))
diff --git a/app/scodoc/sco_archives_etud.py b/app/scodoc/sco_archives_etud.py
index f9a70f2d4..64172b6db 100644
--- a/app/scodoc/sco_archives_etud.py
+++ b/app/scodoc/sco_archives_etud.py
@@ -59,7 +59,7 @@ def can_edit_etud_archive(authuser):
return authuser.has_permission(Permission.ScoEtudAddAnnotations)
-def etud_list_archives_html(REQUEST, etudid):
+def etud_list_archives_html(etudid):
"""HTML snippet listing archives"""
can_edit = can_edit_etud_archive(current_user)
etuds = sco_etud.get_etud_info(etudid=etudid)
@@ -131,7 +131,7 @@ def add_archives_info_to_etud_list(etuds):
etud["etudarchive"] = ", ".join(l)
-def etud_upload_file_form(REQUEST, etudid):
+def etud_upload_file_form(etudid):
"""Page with a form to choose and upload a file, with a description."""
# check permission
if not can_edit_etud_archive(current_user):
@@ -153,7 +153,7 @@ def etud_upload_file_form(REQUEST, etudid):
]
tf = TrivialFormulator(
request.base_url,
- REQUEST.form,
+ request.form if request.method == "POST" else request.args,
(
("etudid", {"default": etudid, "input_type": "hidden"}),
("datafile", {"input_type": "file", "title": "Fichier", "size": 30}),
@@ -198,7 +198,7 @@ def _store_etud_file_to_new_archive(etud_archive_id, data, filename, description
EtudsArchive.store(archive_id, filename, data)
-def etud_delete_archive(REQUEST, etudid, archive_name, dialog_confirmed=False):
+def etud_delete_archive(etudid, archive_name, dialog_confirmed=False):
"""Delete an archive"""
# check permission
if not can_edit_etud_archive(current_user):
@@ -250,7 +250,7 @@ def etud_get_archived_file(etudid, archive_name, filename):
# --- Upload d'un ensemble de fichiers (pour un groupe d'étudiants)
-def etudarchive_generate_excel_sample(group_id=None, REQUEST=None):
+def etudarchive_generate_excel_sample(group_id=None):
"""Feuille excel pour import fichiers etudiants (utilisé pour admissions)"""
fmt = sco_import_etuds.sco_import_format()
data = sco_import_etuds.sco_import_generate_excel_sample(
@@ -274,7 +274,7 @@ def etudarchive_generate_excel_sample(group_id=None, REQUEST=None):
)
-def etudarchive_import_files_form(group_id, REQUEST=None):
+def etudarchive_import_files_form(group_id):
"""Formulaire pour importation fichiers d'un groupe"""
H = [
html_sco_header.sco_header(
@@ -309,7 +309,7 @@ def etudarchive_import_files_form(group_id, REQUEST=None):
F = html_sco_header.sco_footer()
tf = TrivialFormulator(
request.base_url,
- REQUEST.form,
+ request.form if request.method == "POST" else request.args,
(
("xlsfile", {"title": "Fichier Excel:", "input_type": "file", "size": 40}),
("zipfile", {"title": "Fichier zip:", "input_type": "file", "size": 40}),
diff --git a/app/scodoc/sco_bulletins.py b/app/scodoc/sco_bulletins.py
index 91b9a2efc..7d1859a22 100644
--- a/app/scodoc/sco_bulletins.py
+++ b/app/scodoc/sco_bulletins.py
@@ -766,7 +766,6 @@ def formsemestre_bulletinetud(
xml_with_decisions=False,
force_publishing=False, # force publication meme si semestre non publie sur "portail"
prefer_mail_perso=False,
- REQUEST=None,
):
"page bulletin de notes"
try:
@@ -786,7 +785,6 @@ def formsemestre_bulletinetud(
xml_with_decisions=xml_with_decisions,
force_publishing=force_publishing,
prefer_mail_perso=prefer_mail_perso,
- REQUEST=REQUEST,
)[0]
if format not in {"html", "pdfmail"}:
filename = scu.bul_filename(sem, etud, format)
@@ -795,7 +793,7 @@ def formsemestre_bulletinetud(
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
H = [
_formsemestre_bulletinetud_header_html(
- etud, etudid, sem, formsemestre_id, format, version, REQUEST
+ etud, etudid, sem, formsemestre_id, format, version
),
bulletin,
]
@@ -853,7 +851,6 @@ def do_formsemestre_bulletinetud(
etudid,
version="long", # short, long, selectedevals
format="html",
- REQUEST=None,
nohtml=False,
xml_with_decisions=False, # force decisions dans XML
force_publishing=False, # force publication meme si semestre non publie sur "portail"
@@ -1005,7 +1002,6 @@ def _formsemestre_bulletinetud_header_html(
formsemestre_id=None,
format=None,
version=None,
- REQUEST=None,
):
H = [
html_sco_header.sco_header(
diff --git a/app/scodoc/sco_bulletins_pdf.py b/app/scodoc/sco_bulletins_pdf.py
index 719b20a34..81df5b1e4 100644
--- a/app/scodoc/sco_bulletins_pdf.py
+++ b/app/scodoc/sco_bulletins_pdf.py
@@ -164,7 +164,7 @@ def process_field(field, cdict, style, suppress_empty_pars=False, format="pdf"):
return sco_pdf.makeParas(text, style, suppress_empty=suppress_empty_pars)
-def get_formsemestre_bulletins_pdf(formsemestre_id, REQUEST, version="selectedevals"):
+def get_formsemestre_bulletins_pdf(formsemestre_id, version="selectedevals"):
"document pdf et filename"
from app.scodoc import sco_bulletins
@@ -184,7 +184,6 @@ def get_formsemestre_bulletins_pdf(formsemestre_id, REQUEST, version="selectedev
etudid,
format="pdfpart",
version=version,
- REQUEST=REQUEST,
)
fragments += frag
filigrannes[i] = filigranne
@@ -192,7 +191,7 @@ def get_formsemestre_bulletins_pdf(formsemestre_id, REQUEST, version="selectedev
i = i + 1
#
infos = {"DeptName": sco_preferences.get_preference("DeptName", formsemestre_id)}
- if REQUEST:
+ if request:
server_name = request.url_root
else:
server_name = ""
@@ -220,7 +219,7 @@ def get_formsemestre_bulletins_pdf(formsemestre_id, REQUEST, version="selectedev
return pdfdoc, filename
-def get_etud_bulletins_pdf(etudid, REQUEST, version="selectedevals"):
+def get_etud_bulletins_pdf(etudid, version="selectedevals"):
"Bulletins pdf de tous les semestres de l'étudiant, et filename"
from app.scodoc import sco_bulletins
@@ -235,14 +234,13 @@ def get_etud_bulletins_pdf(etudid, REQUEST, version="selectedevals"):
etudid,
format="pdfpart",
version=version,
- REQUEST=REQUEST,
)
fragments += frag
filigrannes[i] = filigranne
bookmarks[i] = sem["session_id"] # eg RT-DUT-FI-S1-2015
i = i + 1
infos = {"DeptName": sco_preferences.get_preference("DeptName")}
- if REQUEST:
+ if request:
server_name = request.url_root
else:
server_name = ""
diff --git a/app/scodoc/sco_bulletins_signature.py b/app/scodoc/sco_bulletins_signature.py
index fead3aa8a..cb4be0303 100644
--- a/app/scodoc/sco_bulletins_signature.py
+++ b/app/scodoc/sco_bulletins_signature.py
@@ -56,7 +56,7 @@ et sur page "réglages bulletin" (avec formsemestre_id)
# import os
-# def form_change_bul_sig(side, formsemestre_id=None, REQUEST=None):
+# def form_change_bul_sig(side, formsemestre_id=None):
# """Change pdf signature"""
# filename = _get_sig_existing_filename(
# side, formsemestre_id=formsemestre_id
@@ -69,7 +69,7 @@ et sur page "réglages bulletin" (avec formsemestre_id)
# raise ValueError("invalid value for 'side' parameter")
# signatureloc = get_bul_sig_img()
# H = [
-# self.sco_header(REQUEST, page_title="Changement de signature"),
+# self.sco_header(page_title="Changement de signature"),
# """Changement de la signature bulletin de %(sidetxt)s
# """
# % (sidetxt,),
diff --git a/app/scodoc/sco_cost_formation.py b/app/scodoc/sco_cost_formation.py
index 7c442f813..1c28ed4f1 100644
--- a/app/scodoc/sco_cost_formation.py
+++ b/app/scodoc/sco_cost_formation.py
@@ -47,7 +47,6 @@ def formsemestre_table_estim_cost(
n_group_tp=1,
coef_tp=1,
coef_cours=1.5,
- REQUEST=None,
):
"""
Rapports estimation coût de formation basé sur le programme pédagogique
@@ -158,7 +157,6 @@ def formsemestre_estim_cost(
coef_tp=1,
coef_cours=1.5,
format="html",
- REQUEST=None,
):
"""Page (formulaire) estimation coûts"""
@@ -173,7 +171,6 @@ def formsemestre_estim_cost(
n_group_tp=n_group_tp,
coef_tp=coef_tp,
coef_cours=coef_cours,
- REQUEST=REQUEST,
)
h = """
Seuls les modules cochés font partie de ce semestre. Pour les retirer, les décocher et appuyer sur le bouton "modifier".
@@ -120,7 +121,7 @@ def formsemestre_editwithmodules(REQUEST, formsemestre_id): return "\n".join(H) + html_sco_header.sco_footer() -def can_edit_sem(REQUEST, formsemestre_id="", sem=None): +def can_edit_sem(formsemestre_id="", sem=None): """Return sem if user can edit it, False otherwise""" sem = sem or sco_formsemestre.get_formsemestre(formsemestre_id) if not current_user.has_permission(Permission.ScoImplement): # pas chef @@ -129,11 +130,12 @@ def can_edit_sem(REQUEST, formsemestre_id="", sem=None): return sem -def do_formsemestre_createwithmodules(REQUEST=None, edit=False): +def do_formsemestre_createwithmodules(edit=False): "Form choix modules / responsables et creation formsemestre" # Fonction accessible à tous, controle acces à la main: + vals = request.form if request.method == "POST" else request.args if edit: - formsemestre_id = int(REQUEST.form["formsemestre_id"]) + formsemestre_id = int(vals["formsemestre_id"]) sem = sco_formsemestre.get_formsemestre(formsemestre_id) if not current_user.has_permission(Permission.ScoImplement): if not edit: @@ -155,14 +157,14 @@ def do_formsemestre_createwithmodules(REQUEST=None, edit=False): uid2display[u.id] = u.get_nomplogin() allowed_user_names = list(uid2display.values()) + [""] # - formation_id = int(REQUEST.form["formation_id"]) + formation_id = int(vals["formation_id"]) F = sco_formations.formation_list(args={"formation_id": formation_id}) if not F: raise ScoValueError("Formation inexistante !") F = F[0] if not edit: initvalues = {"titre": _default_sem_title(F)} - semestre_id = int(REQUEST.form["semestre_id"]) + semestre_id = int(vals["semestre_id"]) sem_module_ids = set() else: # setup form init values @@ -308,7 +310,9 @@ def do_formsemestre_createwithmodules(REQUEST=None, edit=False): { "size": 40, "title": "Nom de ce semestre", - "explanation": """n'indiquez pas les dates, ni le semestre, ni la modalité dans le titre: ils seront automatiquement ajoutés """ + "explanation": """n'indiquez pas les dates, ni le semestre, ni la modalité dans + le titre: ils seront automatiquement ajoutés """ % _default_sem_title(F), }, ), @@ -541,7 +545,7 @@ def do_formsemestre_createwithmodules(REQUEST=None, edit=False): select_name = "%s!group_id" % mod["module_id"] def opt_selected(gid): - if gid == REQUEST.form.get(select_name): + if gid == vals.get(select_name): return "selected" else: return "" @@ -630,38 +634,29 @@ def do_formsemestre_createwithmodules(REQUEST=None, edit=False): initvalues["gestion_compensation_lst"] = ["X"] else: initvalues["gestion_compensation_lst"] = [] - if ( - REQUEST.form.get("tf_submitted", False) - and "gestion_compensation_lst" not in REQUEST.form - ): - REQUEST.form["gestion_compensation_lst"] = [] + if vals.get("tf_submitted", False) and "gestion_compensation_lst" not in vals: + vals["gestion_compensation_lst"] = [] initvalues["gestion_semestrielle"] = initvalues.get("gestion_semestrielle", False) if initvalues["gestion_semestrielle"]: initvalues["gestion_semestrielle_lst"] = ["X"] else: initvalues["gestion_semestrielle_lst"] = [] - if ( - REQUEST.form.get("tf_submitted", False) - and "gestion_semestrielle_lst" not in REQUEST.form - ): - REQUEST.form["gestion_semestrielle_lst"] = [] + if vals.get("tf_submitted", False) and "gestion_semestrielle_lst" not in vals: + vals["gestion_semestrielle_lst"] = [] 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"] = [] - if ( - REQUEST.form.get("tf_submitted", False) - and "bul_publish_xml_lst" not in REQUEST.form - ): - REQUEST.form["bul_publish_xml_lst"] = [] + if vals.get("tf_submitted", False) and "bul_publish_xml_lst" not in vals: + vals["bul_publish_xml_lst"] = [] # tf = TrivialFormulator( request.base_url, - REQUEST.form, + vals, modform, submitlabel=submitlabel, cancelbutton="Annuler", @@ -792,7 +787,6 @@ def do_formsemestre_createwithmodules(REQUEST=None, edit=False): moduleimpl_id, formsemestre_id, etudids, - REQUEST=REQUEST, ) msg += [ "inscription de %d étudiants au module %s" @@ -873,7 +867,7 @@ def formsemestre_delete_moduleimpls(formsemestre_id, module_ids_to_del): return ok, msg -def formsemestre_clone(formsemestre_id, REQUEST=None): +def formsemestre_clone(formsemestre_id): """ Formulaire clonage d'un semestre """ @@ -965,7 +959,7 @@ def formsemestre_clone(formsemestre_id, REQUEST=None): ] tf = TrivialFormulator( request.base_url, - REQUEST.form, + request.form if request.method == "POST" else request.args, descr, submitlabel="Dupliquer ce semestre", cancelbutton="Annuler", @@ -990,7 +984,6 @@ def formsemestre_clone(formsemestre_id, REQUEST=None): tf[2]["date_fin"], clone_evaluations=tf[2]["clone_evaluations"], clone_partitions=tf[2]["clone_partitions"], - REQUEST=REQUEST, ) return flask.redirect( "formsemestre_status?formsemestre_id=%s&head_message=Nouveau%%20semestre%%20créé" @@ -1005,7 +998,6 @@ def do_formsemestre_clone( date_fin, # 'dd/mm/yyyy' clone_evaluations=False, clone_partitions=False, - REQUEST=None, ): """Clone a semestre: make copy, same modules, same options, same resps, same partitions. New dates, responsable_id @@ -1045,7 +1037,7 @@ def do_formsemestre_clone( args = e.copy() del args["jour"] # erase date args["moduleimpl_id"] = mid - _ = sco_evaluations.do_evaluation_create(REQUEST=REQUEST, **args) + _ = sco_evaluations.do_evaluation_create(**args) # 3- copy uecoefs objs = sco_formsemestre.formsemestre_uecoef_list( @@ -1240,7 +1232,7 @@ def _reassociate_moduleimpls(cnx, formsemestre_id, ues_old2new, modules_old2new) sco_parcours_dut.scolar_formsemestre_validation_edit(cnx, e) -def formsemestre_delete(formsemestre_id, REQUEST=None): +def formsemestre_delete(formsemestre_id): """Delete a formsemestre (affiche avertissements)""" sem = sco_formsemestre.get_formsemestre(formsemestre_id) F = sco_formations.formation_list(args={"formation_id": sem["formation_id"]})[0] @@ -1272,7 +1264,7 @@ def formsemestre_delete(formsemestre_id, REQUEST=None): submit_label = "Confirmer la suppression du semestre" tf = TrivialFormulator( request.base_url, - REQUEST.form, + request.form if request.method == "POST" else request.args, (("formsemestre_id", {"input_type": "hidden"}),), initvalues=F, submitlabel=submit_label, @@ -1431,7 +1423,7 @@ def do_formsemestre_delete(formsemestre_id): # --------------------------------------------------------------------------------------- -def formsemestre_edit_options(formsemestre_id, REQUEST=None): +def formsemestre_edit_options(formsemestre_id): """dialog to change formsemestre options (accessible par ScoImplement ou dir. etudes) """ @@ -1439,12 +1431,10 @@ def formsemestre_edit_options(formsemestre_id, REQUEST=None): ok, err = sco_permissions_check.check_access_diretud(formsemestre_id) if not ok: return err - return sco_preferences.SemPreferences(formsemestre_id).edit( - REQUEST=REQUEST, categories=["bul"] - ) + return sco_preferences.SemPreferences(formsemestre_id).edit(categories=["bul"]) -def formsemestre_change_lock(formsemestre_id, REQUEST=None, dialog_confirmed=False): +def formsemestre_change_lock(formsemestre_id, dialog_confirmed=False) -> None: """Change etat (verrouille si ouvert, déverrouille si fermé) nota: etat (1 ouvert, 0 fermé) """ @@ -1454,7 +1444,7 @@ def formsemestre_change_lock(formsemestre_id, REQUEST=None, dialog_confirmed=Fal sem = sco_formsemestre.get_formsemestre(formsemestre_id) etat = not sem["etat"] - if REQUEST and not dialog_confirmed: + if not dialog_confirmed: if etat: msg = "déverrouillage" else: @@ -1474,14 +1464,10 @@ def formsemestre_change_lock(formsemestre_id, REQUEST=None, dialog_confirmed=Fal args = {"formsemestre_id": formsemestre_id, "etat": etat} sco_formsemestre.do_formsemestre_edit(args) - if REQUEST: - return flask.redirect( - "formsemestre_status?formsemestre_id=%s" % formsemestre_id - ) def formsemestre_change_publication_bul( - formsemestre_id, REQUEST=None, dialog_confirmed=False + formsemestre_id, dialog_confirmed=False, redirect=True ): """Change etat publication bulletins sur portail""" ok, err = sco_permissions_check.check_access_diretud(formsemestre_id) @@ -1490,7 +1476,7 @@ def formsemestre_change_publication_bul( sem = sco_formsemestre.get_formsemestre(formsemestre_id) etat = not sem["bul_hide_xml"] - if REQUEST and not dialog_confirmed: + if not dialog_confirmed: if etat: msg = "non" else: @@ -1509,14 +1495,14 @@ def formsemestre_change_publication_bul( args = {"formsemestre_id": formsemestre_id, "bul_hide_xml": etat} sco_formsemestre.do_formsemestre_edit(args) - if REQUEST: + if redirect: return flask.redirect( "formsemestre_status?formsemestre_id=%s" % formsemestre_id ) return None -def formsemestre_edit_uecoefs(formsemestre_id, err_ue_id=None, REQUEST=None): +def formsemestre_edit_uecoefs(formsemestre_id, err_ue_id=None): """Changement manuel des coefficients des UE capitalisées.""" from app.scodoc import notes_table @@ -1585,7 +1571,7 @@ def formsemestre_edit_uecoefs(formsemestre_id, err_ue_id=None, REQUEST=None): tf = TrivialFormulator( request.base_url, - REQUEST.form, + request.form if request.method == "POST" else request.args, form, submitlabel="Changer les coefficients", cancelbutton="Annuler", diff --git a/app/scodoc/sco_formsemestre_exterieurs.py b/app/scodoc/sco_formsemestre_exterieurs.py index 8f8ea5677..5c121e49a 100644 --- a/app/scodoc/sco_formsemestre_exterieurs.py +++ b/app/scodoc/sco_formsemestre_exterieurs.py @@ -52,7 +52,7 @@ from app.scodoc import sco_parcours_dut from app.scodoc import sco_etud -def formsemestre_ext_create(etudid, sem_params, REQUEST=None): +def formsemestre_ext_create(etudid, sem_params): """Crée un formsemestre exterieur et y inscrit l'étudiant. sem_params: dict nécessaire à la création du formsemestre """ @@ -79,7 +79,7 @@ def formsemestre_ext_create(etudid, sem_params, REQUEST=None): return formsemestre_id -def formsemestre_ext_create_form(etudid, formsemestre_id, REQUEST=None): +def formsemestre_ext_create_form(etudid, formsemestre_id): """Formulaire creation/inscription à un semestre extérieur""" etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0] H = [ @@ -182,7 +182,7 @@ def formsemestre_ext_create_form(etudid, formsemestre_id, REQUEST=None): tf = TrivialFormulator( request.base_url, - REQUEST.form, + request.form if request.method == "POST" else request.args, descr, cancelbutton="Annuler", method="post", @@ -204,13 +204,13 @@ def formsemestre_ext_create_form(etudid, formsemestre_id, REQUEST=None): ) else: tf[2]["formation_id"] = orig_sem["formation_id"] - formsemestre_ext_create(etudid, tf[2], REQUEST=REQUEST) + formsemestre_ext_create(etudid, tf[2]) return flask.redirect( url_for("scolar.ficheEtud", scodoc_dept=g.scodoc_dept, etudid=etudid) ) -def formsemestre_ext_edit_ue_validations(formsemestre_id, etudid, REQUEST=None): +def formsemestre_ext_edit_ue_validations(formsemestre_id, etudid): """Edition des validations d'UE et de semestre (jury) pour un semestre extérieur. On peut saisir pour chaque UE du programme de formation @@ -222,8 +222,10 @@ def formsemestre_ext_edit_ue_validations(formsemestre_id, etudid, REQUEST=None): sem = sco_formsemestre.get_formsemestre(formsemestre_id) etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0] ue_list = _list_ue_with_coef_and_validations(sem, etudid) - descr = _ue_form_description(ue_list, REQUEST.form) - if REQUEST and REQUEST.method == "GET": + descr = _ue_form_description( + ue_list, request.form if request.method == "POST" else request.args + ) + if request.method == "GET": initvalues = { "note_" + str(ue["ue_id"]): ue["validation"].get("moy_ue", "") for ue in ue_list @@ -232,7 +234,7 @@ def formsemestre_ext_edit_ue_validations(formsemestre_id, etudid, REQUEST=None): initvalues = {} tf = TrivialFormulator( request.base_url, - REQUEST.form, + request.form if request.method == "POST" else request.args, descr, cssclass="tf_ext_edit_ue_validations", submitlabel="Enregistrer ces validations", @@ -242,19 +244,19 @@ def formsemestre_ext_edit_ue_validations(formsemestre_id, etudid, REQUEST=None): if tf[0] == -1: return "