FIX regression / REQUEST+formulaires / + passage étudiants

This commit is contained in:
Emmanuel Viennet 2021-09-27 16:42:14 +02:00
parent d577066911
commit f012fe6fcf
29 changed files with 112 additions and 89 deletions

View File

@ -20,6 +20,7 @@ import flask_login
import app
from app.auth.models import User
import app.scodoc.sco_utils as scu
class ZUser(object):
@ -141,7 +142,6 @@ def scodoc7func(func):
1. via a Flask route ("top level call")
2. or be called directly from Python.
If called via a route, this decorator setups a REQUEST object (emulating Zope2 REQUEST)
"""
# Détermine si on est appelé via une route ("toplevel")
# ou par un appel de fonction python normal.
@ -154,7 +154,7 @@ def scodoc7func(func):
# REQUEST = ZRequest()
# g.zrequest = REQUEST
# args from query string (get) or form (post)
req_args = request.form if request.method == "POST" else request.args
req_args = scu.get_request_args()
## --- Add positional arguments
pos_arg_values = []
argspec = inspect.getfullargspec(func)
@ -164,12 +164,10 @@ def scodoc7func(func):
arg_names = argspec.args[:-nb_default_args]
else:
arg_names = argspec.args
for arg_name in arg_names:
if arg_name == "REQUEST": # special case
raise ValueError(
"invalid REQUEST parameter !"
) # debug check, TODO remove after tests
# pos_arg_values.append(REQUEST)
for arg_name in arg_names: # pour chaque arg de la fonction vue
if arg_name == "REQUEST": # ne devrait plus arriver !
# debug check, TODO remove after tests
raise ValueError("invalid REQUEST parameter !")
else:
# peut produire une KeyError s'il manque un argument attendu:
v = req_args[arg_name]

View File

@ -453,7 +453,7 @@ enregistrés et non modifiables, on peut les retrouver ultérieurement.
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
cancelbutton="Annuler",
method="POST",

View File

@ -153,7 +153,7 @@ def etud_upload_file_form(etudid):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("etudid", {"default": etudid, "input_type": "hidden"}),
("datafile", {"input_type": "file", "title": "Fichier", "size": 30}),
@ -309,7 +309,7 @@ def etudarchive_import_files_form(group_id):
F = html_sco_header.sco_footer()
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("xlsfile", {"title": "Fichier Excel:", "input_type": "file", "size": 40}),
("zipfile", {"title": "Fichier zip:", "input_type": "file", "size": 40}),

View File

@ -160,7 +160,7 @@ def formation_edit(formation_id=None, create=False):
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("formation_id", {"default": formation_id, "input_type": "hidden"}),
(

View File

@ -117,7 +117,7 @@ associé.
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("ue_id", {"input_type": "hidden", "default": ue_id}),
("titre", {"size": 30, "explanation": "nom de la matière."}),
@ -203,7 +203,7 @@ def matiere_delete(matiere_id=None):
dest_url = scu.NotesURL() + "/ue_list?formation_id=" + str(UE["formation_id"])
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(("matiere_id", {"input_type": "hidden"}),),
initvalues=M,
submitlabel="Confirmer la suppression",
@ -257,7 +257,7 @@ associé.
</p>"""
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("matiere_id", {"input_type": "hidden"}),
(

View File

@ -145,7 +145,7 @@ def module_create(matiere_id=None):
default_num = 10
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
(
"code",
@ -297,7 +297,7 @@ def module_delete(module_id=None):
dest_url = scu.NotesURL() + "/ue_list?formation_id=" + str(Mod["formation_id"])
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(("module_id", {"input_type": "hidden"}),),
initvalues=Mod,
submitlabel="Confirmer la suppression",
@ -391,7 +391,7 @@ def module_edit(module_id=None):
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
(
"code",

View File

@ -328,7 +328,7 @@ def ue_edit(ue_id=None, create=False, formation_id=None):
)
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
fw,
initvalues=initvalues,
submitlabel=submitlabel,

View File

@ -1227,9 +1227,9 @@ def evaluation_create_form(
initvalues["visibulletinlist"] = ["X"]
else:
initvalues["visibulletinlist"] = []
vals = (request.form if request.method == "POST" else request.args).copy()
vals = scu.get_request_args()
if vals.get("tf_submitted", False) and "visibulletinlist" not in vals:
request.form["visibulletinlist"] = []
vals["visibulletinlist"] = []
#
form = [
("evaluation_id", {"default": evaluation_id, "input_type": "hidden"}),

View File

@ -136,11 +136,11 @@ def search_etud_in_dept(expnom=""):
vals = {}
url_args = {"scodoc_dept": g.scodoc_dept}
if "dest_url" in request.form:
endpoint = request.form["dest_url"]
if "dest_url" in vals:
endpoint = vals["dest_url"]
else:
endpoint = "scolar.ficheEtud"
if "parameters_keys" in request.form:
if "parameters_keys" in vals:
for key in vals["parameters_keys"].split(","):
url_args[key] = vals[key]

View File

@ -118,7 +118,7 @@ def formsemestre_custommenu_edit(formsemestre_id):
initvalues["url_" + str(item["custommenu_id"])] = item["url"]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
initvalues=initvalues,
cancelbutton="Annuler",

View File

@ -109,7 +109,7 @@ def formsemestre_editwithmodules(formsemestre_id):
H.append(r)
else:
return r # response redirect
vals = (request.form if request.method == "POST" else request.args).copy()
scu.get_request_args()
if not vals.get("tf_submitted", False):
H.append(
"""<p class="help">Seuls les modules cochés font partie de ce semestre. Pour les retirer, les décocher et appuyer sur le bouton "modifier".
@ -133,7 +133,7 @@ def can_edit_sem(formsemestre_id="", sem=None):
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).copy()
vals = scu.get_request_args()
if edit:
formsemestre_id = int(vals["formsemestre_id"])
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
@ -959,7 +959,7 @@ def formsemestre_clone(formsemestre_id):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
submitlabel="Dupliquer ce semestre",
cancelbutton="Annuler",
@ -1264,7 +1264,7 @@ def formsemestre_delete(formsemestre_id):
submit_label = "Confirmer la suppression du semestre"
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(("formsemestre_id", {"input_type": "hidden"}),),
initvalues=F,
submitlabel=submit_label,
@ -1553,7 +1553,7 @@ def formsemestre_edit_uecoefs(formsemestre_id, err_ue_id=None):
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
form,
submitlabel="Changer les coefficients",
cancelbutton="Annuler",

View File

@ -182,7 +182,7 @@ def formsemestre_ext_create_form(etudid, formsemestre_id):
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
cancelbutton="Annuler",
method="post",
@ -222,9 +222,7 @@ def formsemestre_ext_edit_ue_validations(formsemestre_id, etudid):
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.method == "POST" else request.args
)
descr = _ue_form_description(ue_list, scu.get_request_args())
if request.method == "GET":
initvalues = {
"note_" + str(ue["ue_id"]): ue["validation"].get("moy_ue", "")
@ -234,7 +232,7 @@ def formsemestre_ext_edit_ue_validations(formsemestre_id, etudid):
initvalues = {}
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
cssclass="tf_ext_edit_ue_validations",
submitlabel="Enregistrer ces validations",

View File

@ -467,7 +467,7 @@ def formsemestre_inscription_option(etudid, formsemestre_id):
modimpls_by_ue_names[ue_id].append(
"%s %s" % (mod["module"]["code"], mod["module"]["titre"])
)
vals = (request.form if request.method == "POST" else request.args).copy()
scu.get_request_args()
if not vals.get("tf_submitted", False):
# inscrit ?
for ins in inscr:
@ -534,7 +534,7 @@ function chkbx_select(field_id, state) {
)
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
initvalues,
cancelbutton="Annuler",

View File

@ -1008,7 +1008,7 @@ def formsemestre_validate_previous_ue(formsemestre_id, etudid):
ue_ids = [""] + [ue["ue_id"] for ue in ues]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("etudid", {"input_type": "hidden"}),
("formsemestre_id", {"input_type": "hidden"}),

View File

@ -1082,7 +1082,7 @@ def partition_rename(partition_id):
H = ["<h2>Renommer une partition</h2>"]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("partition_id", {"default": partition_id, "input_type": "hidden"}),
(
@ -1189,7 +1189,7 @@ def group_rename(group_id):
H = ["<h2>Renommer un groupe de %s</h2>" % group["partition_name"]]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("group_id", {"default": group_id, "input_type": "hidden"}),
(
@ -1267,7 +1267,7 @@ def groups_auto_repartition(partition_id=None):
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
{},
cancelbutton="Annuler",

View File

@ -291,6 +291,8 @@ def formsemestre_inscr_passage(
etuds = etuds.split(",") # vient du form de confirmation
elif isinstance(etuds, int):
etuds = [etuds]
elif isinstance(etuds, list):
etuds = [int(x) for x in etuds]
auth_etuds_by_sem, inscrits, candidats = list_authorized_etuds_by_sem(sem)
etuds_set = set(etuds)
candidats_set = set(candidats)
@ -353,7 +355,7 @@ def formsemestre_inscr_passage(
OK="Effectuer l'opération",
parameters={
"formsemestre_id": formsemestre_id,
"etuds": ",".join(etuds),
"etuds": ",".join([str(x) for x in etuds]),
"inscrit_groupes": inscrit_groupes,
"submitted": 1,
},

View File

@ -64,7 +64,7 @@ def do_evaluation_listenotes():
(si moduleimpl_id, affiche toutes les évaluatons du module)
"""
mode = None
vals = (request.form if request.method == "POST" else request.args).copy()
scu.get_request_args()
if "evaluation_id" in vals:
evaluation_id = int(vals["evaluation_id"])
mode = "eval"
@ -179,7 +179,7 @@ def do_evaluation_listenotes():
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
cancelbutton=None,
submitbutton=None,

View File

@ -2033,7 +2033,7 @@ class BasePreferences(object):
form = self.build_tf_form()
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
form,
initvalues=self.prefs[None],
submitlabel="Enregistrer les modifications",
@ -2198,7 +2198,7 @@ function set_global_pref(el, pref_name) {
form.append(("formsemestre_id", {"input_type": "hidden"}))
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
form,
initvalues=self,
cssclass="sco_pref",

View File

@ -656,7 +656,7 @@ def formsemestre_pvjury_pdf(formsemestre_id, group_ids=[], etudid=None):
menu_choix_groupe = "" # un seul etudiant à editer
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
cancelbutton="Annuler",
method="get",
@ -824,7 +824,7 @@ def formsemestre_lettres_individuelles(formsemestre_id, group_ids=[]):
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
cancelbutton="Annuler",
method="POST",

View File

@ -169,7 +169,7 @@ def do_evaluation_upload_xls():
Soumission d'un fichier XLS (evaluation_id, notefile)
"""
authuser = current_user
vals = (request.form if request.method == "POST" else request.args).copy()
scu.get_request_args()
evaluation_id = int(vals["evaluation_id"])
comment = vals["comment"]
E = sco_evaluations.do_evaluation_list({"evaluation_id": evaluation_id})[0]
@ -658,7 +658,7 @@ def saisie_notes_tableur(evaluation_id, group_ids=[]):
nf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("evaluation_id", {"default": evaluation_id, "input_type": "hidden"}),
(
@ -1179,7 +1179,7 @@ def _form_saisie_notes(E, M, group_ids, destination=""):
tf = TF(
destination,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
initvalues=initvalues,
submitbutton=False,

View File

@ -514,7 +514,7 @@ def photos_import_files_form(group_ids=[]):
% groups_infos.groups_query_args,
]
F = html_sco_header.sco_footer()
vals = (request.form if request.method == "POST" else request.args).copy()
scu.get_request_args()
vals["group_ids"] = groups_infos.group_ids
tf = TrivialFormulator(
request.base_url,

View File

@ -245,7 +245,7 @@ def external_ue_create_form(formsemestre_id, etudid):
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("formsemestre_id", {"input_type": "hidden"}),
("etudid", {"input_type": "hidden"}),

View File

@ -45,16 +45,14 @@ import unicodedata
import urllib
from urllib.parse import urlparse, parse_qsl, urlunparse, urlencode
from flask import g, current_app
from PIL import Image as PILImage
from flask import g, url_for, request, make_response
from flask import g, request
from flask import url_for, make_response
from config import Config
from app import log
from app.scodoc.sco_vdi import ApoEtapeVDI
from app.scodoc.sco_xml import quote_xml_attr
from app.scodoc.sco_codes_parcours import NOTES_TOLERANCE, CODES_EXPL
from app.scodoc import sco_exceptions
from app.scodoc import sco_xml
@ -622,6 +620,33 @@ def send_file(data, filename="", suffix="", mime=None, attached=None):
return response
def get_request_args():
"""returns a dict with request (POST or GET) arguments
converted to suit legacy Zope style (scodoc7) functions.
"""
# copy to get a mutable object (necessary for TrivialFormulator and several methods)
if request.method == "POST":
# request.form is a werkzeug.datastructures.ImmutableMultiDict
# must copy to get a mutable version (needed by TrivialFormulator)
vals = request.form.copy()
if request.files:
# Add files in form:
vals.update(request.files)
for k in request.form:
if k.endswith(":list"):
vals[k[:-5]] = request.form.getlist(k)
elif request.method == "GET":
vals = {}
for k in request.args:
# current_app.logger.debug("%s\t%s" % (k, request.args.getlist(k)))
if k.endswith(":list"):
vals[k[:-5]] = request.args.getlist(k)
else:
values = request.args.getlist(k)
vals[k] = values[0] if len(values) == 1 else values
return vals
def get_scodoc_version():
"return a string identifying ScoDoc version"
return sco_version.SCOVERSION

View File

@ -1116,7 +1116,7 @@ def AddBilletAbsenceForm(etudid):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("etudid", {"input_type": "hidden"}),
("begin", {"input_type": "date"}),
@ -1263,7 +1263,7 @@ def listeBillets():
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(("billet_id", {"input_type": "text", "title": "Numéro du billet"}),),
submitbutton=False,
)
@ -1392,7 +1392,7 @@ def ProcessBilletAbsenceForm(billet_id):
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("billet_id", {"input_type": "hidden"}),
(

View File

@ -94,7 +94,7 @@ def sidebar():
)
# --- entreprise selectionnée:
vals = (request.form if request.method == "POST" else request.args).copy()
scu.get_request_args()
if "entreprise_id" in vals:
entreprise_id = vals["entreprise_id"]
E = sco_entreprises.do_entreprise_list(args={"entreprise_id": entreprise_id})
@ -147,7 +147,7 @@ def index_html(etud_nom=None, limit=50, offset="", format="html"):
limit = int(limit)
if offset:
offset = int(offset or 0)
vals = (request.form if request.method == "POST" else request.args).copy()
scu.get_request_args()
if etud_nom:
entreprises = sco_entreprises.do_entreprise_list_by_etud(
args=vals, sort_on_contact=True
@ -444,7 +444,7 @@ def entreprise_contact_edit(entreprise_contact_id):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
(
"entreprise_contact_id",
@ -558,7 +558,7 @@ def entreprise_correspondant_edit(entreprise_corresp_id):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
(
"entreprise_corresp_id",
@ -680,7 +680,7 @@ def entreprise_contact_create(entreprise_id):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("entreprise_id", {"input_type": "hidden", "default": entreprise_id}),
(
@ -777,7 +777,7 @@ def entreprise_contact_delete(entreprise_contact_id):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(("entreprise_contact_id", {"input_type": "hidden"}),),
initvalues=c,
submitlabel="Confirmer la suppression",
@ -808,7 +808,7 @@ def entreprise_correspondant_create(entreprise_id):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("entreprise_id", {"input_type": "hidden", "default": entreprise_id}),
(
@ -912,7 +912,7 @@ def entreprise_correspondant_delete(entreprise_corresp_id):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(("entreprise_corresp_id", {"input_type": "hidden"}),),
initvalues=c,
submitlabel="Confirmer la suppression",
@ -966,7 +966,7 @@ def entreprise_delete(entreprise_id):
H.append("""</ul>""")
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(("entreprise_id", {"input_type": "hidden"}),),
initvalues=E,
submitlabel="Confirmer la suppression",
@ -996,7 +996,7 @@ def entreprise_create():
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("nom", {"size": 25, "title": "Nom de l'entreprise"}),
(
@ -1091,7 +1091,7 @@ def entreprise_edit(entreprise_id, start=1):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("entreprise_id", {"default": entreprise_id, "input_type": "hidden"}),
("start", {"default": 1, "input_type": "hidden"}),

View File

@ -505,7 +505,7 @@ def formation_import_xml_form():
footer = html_sco_header.sco_footer()
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(("xmlfile", {"input_type": "file", "title": "Fichier XML", "size": 30}),),
submitlabel="Importer",
cancelbutton="Annuler",
@ -812,7 +812,7 @@ def edit_enseignants_form(moduleimpl_id):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
modform,
submitlabel="Ajouter enseignant",
cancelbutton="Annuler",
@ -908,7 +908,7 @@ def edit_moduleimpl_resp(moduleimpl_id):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
form,
submitlabel="Changer responsable",
cancelbutton="Annuler",
@ -1011,7 +1011,7 @@ def edit_moduleimpl_expr(moduleimpl_id):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
form,
submitlabel="Modifier formule de calcul",
cancelbutton="Annuler",
@ -1169,7 +1169,7 @@ def edit_ue_expr(formsemestre_id, ue_id):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
form,
submitlabel="Modifier formule de calcul",
cancelbutton="Annuler",
@ -1560,7 +1560,7 @@ def evaluation_delete(evaluation_id):
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(("evaluation_id", {"input_type": "hidden"}),),
initvalues=E,
submitlabel="Confirmer la suppression",
@ -1892,7 +1892,7 @@ def appreciation_add_form(
app = apps[0]
formsemestre_id = app["formsemestre_id"]
etudid = app["etudid"]
vals = (request.form if request.method == "POST" else request.args).copy()
scu.get_request_args()
if "edit" in vals:
edit = int(vals["edit"])
elif id:
@ -1943,7 +1943,7 @@ def appreciation_add_form(
initvalues = {}
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
initvalues=initvalues,
cancelbutton="Annuler",

View File

@ -601,7 +601,7 @@ def formChangeCoordonnees(etudid):
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("adresse_id", {"input_type": "hidden"}),
("etudid", {"input_type": "hidden"}),
@ -807,7 +807,7 @@ def formChangePhoto(etudid=None):
]
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
("etudid", {"default": etudid, "input_type": "hidden"}),
(
@ -1134,7 +1134,7 @@ def _etudident_create_or_edit_form(edit):
"Le formulaire HTML"
H = [html_sco_header.sco_header(init_jquery_ui=True)]
F = html_sco_header.sco_footer()
vals = (request.form if request.method == "POST" else request.args).copy()
scu.get_request_args()
etudid = vals.get("etudid", None)
cnx = ndb.GetDBConnexion()
descr = []
@ -1177,7 +1177,7 @@ def _etudident_create_or_edit_form(edit):
# except ValueError:
# infos = None
# pass # XXX a terminer
vals = (request.form if request.method == "POST" else request.args).copy()
scu.get_request_args()
nom = vals.get("nom", None)
if nom is None:
nom = initvalues.get("nom", None)
@ -1470,7 +1470,7 @@ def _etudident_create_or_edit_form(edit):
initvalues["dont_check_homonyms"] = False
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
descr,
submitlabel=submitlabel,
cancelbutton="Re-interroger Apogee",
@ -1829,7 +1829,7 @@ def form_students_import_excel(formsemestre_id=None):
F = html_sco_header.sco_footer()
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
(
"csvfile",
@ -1997,7 +1997,7 @@ def form_students_import_infos_admissions(formsemestre_id=None):
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
(
"csvfile",

View File

@ -330,7 +330,7 @@ def create_user_form(user_name=None, edit=0, all_roles=1):
},
),
]
vals = (request.form if request.method == "POST" else request.args).copy()
scu.get_request_args()
if "tf_submitted" in vals and not "roles" in vals:
vals["roles"] = []
if "tf_submitted" in vals:
@ -527,7 +527,7 @@ def import_users_form():
F = html_sco_header.sco_footer()
tf = TrivialFormulator(
request.base_url,
request.form if request.method == "POST" else request.args,
scu.get_request_args(),
(
(
"xlsfile",

View File

@ -1,7 +1,7 @@
# -*- mode: python -*-
# -*- coding: utf-8 -*-
SCOVERSION = "9.0.40"
SCOVERSION = "9.0.41"
SCONAME = "ScoDoc"