règle de calcul standard'
)
- if sco_moduleimpl.can_change_ens(REQUEST, moduleimpl_id, raise_exc=False):
+ if sco_moduleimpl.can_change_ens(moduleimpl_id, raise_exc=False):
H.append(
' (changer)'
% moduleimpl_id
diff --git a/app/scodoc/sco_news.py b/app/scodoc/sco_news.py
index 0b0544ea0..a564bfd8c 100644
--- a/app/scodoc/sco_news.py
+++ b/app/scodoc/sco_news.py
@@ -90,7 +90,7 @@ def add(typ, object=None, text="", url=None, max_frequency=False):
cnx = ndb.GetDBConnexion()
args = {
"authenticated_user": authuser_name,
- "user_info": sco_users.user_info(user_name=authuser_name),
+ "user_info": sco_users.user_info(authuser_name),
"type": typ,
"object": object,
"text": text,
@@ -163,8 +163,7 @@ def scolar_news_summary(n=5):
% infos
)
n["text"] += (
- " par "
- + sco_users.user_info(user_name=n["authenticated_user"])["nomcomplet"]
+ " par " + sco_users.user_info(n["authenticated_user"])["nomcomplet"]
)
return news
diff --git a/app/scodoc/sco_page_etud.py b/app/scodoc/sco_page_etud.py
index 961c9d615..109c1ddf5 100644
--- a/app/scodoc/sco_page_etud.py
+++ b/app/scodoc/sco_page_etud.py
@@ -144,14 +144,13 @@ def _menuScolarite(authuser, sem, etudid):
def ficheEtud(etudid=None, REQUEST=None):
"fiche d'informations sur un etudiant"
- log("XXX ficheEtud etudid=%s" % etudid)
authuser = REQUEST.AUTHENTICATED_USER
cnx = ndb.GetDBConnexion()
if etudid and REQUEST:
# la sidebar est differente s'il y a ou pas un etudid
# voir html_sidebar.sidebar()
REQUEST.form["etudid"] = etudid
- args = sco_etud.make_etud_args(etudid=etudid, REQUEST=REQUEST)
+ args = sco_etud.make_etud_args(etudid=etudid)
etuds = sco_etud.etudident_list(cnx, args)
if not etuds:
log("ficheEtud: etudid=%s REQUEST.form=%s" % (etudid, REQUEST.form))
@@ -494,7 +493,7 @@ def menus_etud(REQUEST=None):
return ""
authuser = REQUEST.AUTHENTICATED_USER
- etud = sco_etud.get_etud_info(filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True)[0]
menuEtud = [
{
@@ -539,7 +538,7 @@ def etud_info_html(etudid, with_photo="1", REQUEST=None, debug=False):
"""
formsemestre_id = sco_formsemestre_status.retreive_formsemestre_from_request()
with_photo = int(with_photo)
- etud = sco_etud.get_etud_info(filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True)[0]
photo_html = sco_photos.etud_photo_html(
etud, title="fiche de " + etud["nom"], REQUEST=REQUEST
)
diff --git a/app/scodoc/sco_permissions_check.py b/app/scodoc/sco_permissions_check.py
index c062b0767..0bf77b390 100644
--- a/app/scodoc/sco_permissions_check.py
+++ b/app/scodoc/sco_permissions_check.py
@@ -6,6 +6,8 @@
from flask import g
from flask_login import current_user
+from app.auth.models import User
+
import app.scodoc.notesdb as ndb
from app.scodoc.sco_permissions import Permission
from app.scodoc import html_sco_header
@@ -24,7 +26,6 @@ def can_edit_notes(authuser, moduleimpl_id, allow_ens=True):
from app.scodoc import sco_formsemestre
from app.scodoc import sco_parcours_dut
- uid = str(authuser)
M = sco_moduleimpl.do_moduleimpl_list(moduleimpl_id=moduleimpl_id)[0]
sem = sco_formsemestre.get_formsemestre(M["formsemestre_id"])
if not sem["etat"]:
@@ -34,18 +35,18 @@ def can_edit_notes(authuser, moduleimpl_id, allow_ens=True):
# il y a des décisions de jury dans ce semestre !
return (
authuser.has_permission(Permission.ScoEditAllNotes)
- or uid in sem["responsables"]
+ or authuser.id in sem["responsables"]
)
else:
if (
(not authuser.has_permission(Permission.ScoEditAllNotes))
- and uid != M["responsable_id"]
- and uid not in sem["responsables"]
+ and authuser.id != M["responsable_id"]
+ and authuser.id not in sem["responsables"]
):
# enseignant (chargé de TD) ?
if allow_ens:
for ens in M["ens"]:
- if ens["ens_id"] == uid:
+ if ens["ens_id"] == authuser.id:
return True
return False
else:
@@ -58,26 +59,23 @@ def can_edit_evaluation(moduleimpl_id=None):
Sinon, lance une exception.
(nb: n'implique pas le droit de saisir ou modifier des notes)
"""
- # was _evaluation_check_write_access
- # AccessDenied("Modification évaluation impossible pour %s" % (uid,))
from app.scodoc import sco_formsemestre
# acces pour resp. moduleimpl et resp. form semestre (dir etud)
if moduleimpl_id is None:
raise ValueError("no moduleimpl specified") # bug
- uid = current_user.user_name
M = sco_moduleimpl.do_moduleimpl_list(moduleimpl_id=moduleimpl_id)[0]
sem = sco_formsemestre.get_formsemestre(M["formsemestre_id"])
if (
current_user.has_permission(Permission.ScoEditAllEvals)
- or uid == M["responsable_id"]
- or uid in sem["responsables"]
+ or current_user.id == M["responsable_id"]
+ or current_user.id in sem["responsables"]
):
return True
elif sem["ens_can_edit_eval"]:
for ens in M["ens"]:
- if ens["ens_id"] == uid:
+ if ens["ens_id"] == current_user.id:
return True
return False
@@ -130,7 +128,7 @@ def is_chef_or_diretud(sem):
"Vrai si utilisateur est admin, chef dept ou responsable du semestre"
if (
current_user.has_permission(Permission.ScoImplement)
- or current_user.user_name in sem["responsables"]
+ or current_user.id in sem["responsables"]
):
return True
return False
@@ -145,9 +143,9 @@ def check_access_diretud(formsemestre_id, required_permission=Permission.ScoImpl
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
header = html_sco_header.sco_header(page_title="Accès interdit")
footer = html_sco_header.sco_footer()
- if (
- current_user.user_name not in sem["responsables"]
- ) and not current_user.has_permission(required_permission):
+ if (current_user.id not in sem["responsables"]) and not current_user.has_permission(
+ required_permission
+ ):
return (
False,
"\n".join(
@@ -155,7 +153,9 @@ def check_access_diretud(formsemestre_id, required_permission=Permission.ScoImpl
header,
"Opération non autorisée pour %s" % current_user,
"Responsable de ce semestre : %s "
- % ", ".join(sem["responsables"]),
+ % ", ".join(
+ [User.query.get(i).get_prenomnom() for i in sem["responsables"]]
+ ),
footer,
]
),
@@ -173,7 +173,7 @@ def can_change_groups(formsemestre_id):
return False # semestre verrouillé
if current_user.has_permission(Permission.ScoEtudChangeGroups):
return True # admin, chef dept
- if current_user.user_name in sem["responsables"]:
+ if current_user.id in sem["responsables"]:
return True
return False
diff --git a/app/scodoc/sco_photos.py b/app/scodoc/sco_photos.py
index e3f31a0bf..579ac8254 100644
--- a/app/scodoc/sco_photos.py
+++ b/app/scodoc/sco_photos.py
@@ -125,7 +125,7 @@ def get_photo_image(etudid=None, size="small", REQUEST=None):
if not etudid:
filename = UNKNOWN_IMAGE_PATH
else:
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
filename = photo_pathname(etud, size=size)
if not filename:
filename = UNKNOWN_IMAGE_PATH
@@ -178,7 +178,7 @@ def etud_photo_html(etud=None, etudid=None, title=None, size="small", REQUEST=No
"""
if not etud:
if etudid:
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
else:
raise ValueError("etud_photo_html: either etud or etudid must be specified")
photo_url = etud_photo_url(etud, size=size)
diff --git a/app/scodoc/sco_pvjury.py b/app/scodoc/sco_pvjury.py
index 0b15d5a1f..d7bc9c8ba 100644
--- a/app/scodoc/sco_pvjury.py
+++ b/app/scodoc/sco_pvjury.py
@@ -609,7 +609,7 @@ def formsemestre_pvjury_pdf(formsemestre_id, group_ids=[], etudid=None, REQUEST=
groups_infos = None
if etudid:
# PV pour ce seul étudiant:
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1)[0]
+ etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
etuddescr = '%s' % (
etudid,
etud["nomprenom"],
diff --git a/app/scodoc/sco_pvpdf.py b/app/scodoc/sco_pvpdf.py
index b81c48d2b..41dce9baa 100644
--- a/app/scodoc/sco_pvpdf.py
+++ b/app/scodoc/sco_pvpdf.py
@@ -42,6 +42,8 @@ from reportlab.lib.pagesizes import A4, landscape
from reportlab.lib import styles
from reportlab.lib.colors import Color
+from flask import g
+
import app.scodoc.sco_utils as scu
from app.scodoc import sco_bulletins_pdf
from app.scodoc import sco_codes_parcours
diff --git a/app/scodoc/sco_synchro_etuds.py b/app/scodoc/sco_synchro_etuds.py
index ee84ec57f..fceeb9def 100644
--- a/app/scodoc/sco_synchro_etuds.py
+++ b/app/scodoc/sco_synchro_etuds.py
@@ -194,7 +194,7 @@ def formsemestre_synchro_etuds(
if a_desinscrire or a_desinscrire_without_key:
H.append("Etudiants à désinscrire :")
for key in a_desinscrire:
- etud = sco_etud.get_etud_info(filled=1, code_nip=key)[0]
+ etud = sco_etud.get_etud_info(filled=True, code_nip=key)[0]
H.append('- %(nomprenom)s
' % etud)
for etudid in a_desinscrire_without_key:
etud = inscrits_without_key_all[etudid]
@@ -794,7 +794,7 @@ def formsemestre_import_etud_admission(
for i in ins:
etudid = i["etudid"]
- info = sco_etud.get_etud_info(etudid=etudid, filled=1)[0]
+ info = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
code_nip = info["code_nip"]
if not code_nip:
no_nip.append(etudid)
diff --git a/app/scodoc/sco_ue_external.py b/app/scodoc/sco_ue_external.py
index a2693c4d7..5c9f56261 100644
--- a/app/scodoc/sco_ue_external.py
+++ b/app/scodoc/sco_ue_external.py
@@ -81,7 +81,6 @@ def external_ue_create(
acronyme="",
ue_type=sco_codes_parcours.UE_STANDARD,
ects=0.0,
- REQUEST=None,
):
"""Crée UE/matiere/module/evaluation puis saisie les notes"""
log("external_ue_create( formsemestre_id=%s, titre=%s )" % (formsemestre_id, titre))
@@ -127,9 +126,8 @@ def external_ue_create(
{
"module_id": module_id,
"formsemestre_id": formsemestre_id,
- "responsable_id": sem["responsables"][
- 0
- ], # affecte le 1er responsable du semestre comme resp. du module
+ # affecte le 1er responsable du semestre comme resp. du module
+ "responsable_id": sem["responsables"][0],
},
)
@@ -217,7 +215,7 @@ def external_ue_create_form(formsemestre_id, etudid, REQUEST=None):
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")
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
formation_id = sem["formation_id"]
existing_external_ue = get_existing_external_ue(formation_id)
@@ -357,7 +355,6 @@ def external_ue_create_form(formsemestre_id, etudid, REQUEST=None):
)
moduleimpl_id = external_ue_create(
formsemestre_id,
- REQUEST=REQUEST,
titre=tf[2]["titre"],
acronyme=acronyme,
ue_type=tf[2]["type"], # type de l'UE
diff --git a/app/scodoc/sco_users.py b/app/scodoc/sco_users.py
index 15935c79d..0068d14ab 100644
--- a/app/scodoc/sco_users.py
+++ b/app/scodoc/sco_users.py
@@ -238,17 +238,18 @@ def _user_list(user_name):
return None
-def user_info(user_name=None, user=None):
+def user_info(user_name_or_id=None, user=None):
"""Dict avec infos sur l'utilisateur (qui peut ne pas etre dans notre base).
Si user_name est specifie (string ou id), interroge la BD. Sinon, user doit etre une instance
de User.
"""
- if user_name is not None:
- if isinstance(user_name, int):
- u = User.query.filter_by(id=user_name).first()
+ if user_name_or_id is not None:
+ if isinstance(user_name_or_id, int):
+ u = User.query.filter_by(id=user_name_or_id).first()
else:
- u = User.query.filter_by(user_name=user_name).first()
+ u = User.query.filter_by(user_name=user_name_or_id).first()
if u:
+ user_name = u.user_name
info = u.to_dict()
else:
info = None
diff --git a/app/views/absences.py b/app/views/absences.py
index 1b76a69e7..f7070e141 100644
--- a/app/views/absences.py
+++ b/app/views/absences.py
@@ -151,7 +151,7 @@ def index_html(REQUEST=None):
H.append(
"""Pour signaler, annuler ou justifier une absence, choisissez d'abord l'étudiant concerné: """
)
- H.append(sco_find_etud.form_search_etud(REQUEST))
+ H.append(sco_find_etud.form_search_etud())
if authuser.has_permission(Permission.ScoAbsChange):
H.extend(
(
@@ -1070,9 +1070,7 @@ def AddBilletAbsence(
"""
t0 = time.time()
# check etudid
- etuds = sco_etud.get_etud_info(
- etudid=etudid, code_nip=code_nip, REQUEST=REQUEST, filled=True
- )
+ etuds = sco_etud.get_etud_info(etudid=etudid, code_nip=code_nip, filled=True)
if not etuds:
return scu.log_unknown_etud(REQUEST=REQUEST)
etud = etuds[0]
@@ -1117,7 +1115,7 @@ def AddBilletAbsenceForm(etudid, REQUEST=None):
"""Formulaire ajout billet (pour tests seulement, le vrai formulaire accessible aux etudiants
étant sur le portail étudiant).
"""
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
H = [
html_sco_header.sco_header(
page_title="Billet d'absence de %s" % etud["nomprenom"]
@@ -1227,7 +1225,7 @@ def _tableBillets(billets, etud=None, title=""):
@scodoc7func
def listeBilletsEtud(etudid=False, REQUEST=None, format="html"):
"""Liste billets pour un etudiant"""
- etuds = sco_etud.get_etud_info(etudid=etudid, filled=1, REQUEST=REQUEST)
+ etuds = sco_etud.get_etud_info(filled=True, etudid=etudid)
if not etuds:
return scu.log_unknown_etud(format=format, REQUEST=REQUEST)
@@ -1386,7 +1384,7 @@ def ProcessBilletAbsenceForm(billet_id, REQUEST=None):
)
billet = billets[0]
etudid = billet["etudid"]
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
H = [
html_sco_header.sco_header(
@@ -1470,7 +1468,7 @@ def ProcessBilletAbsenceForm(billet_id, REQUEST=None):
def XMLgetAbsEtud(beg_date="", end_date="", REQUEST=None):
"""returns list of absences in date interval"""
t0 = time.time()
- etud = sco_etud.get_etud_info(REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=False)[0]
exp = re.compile(r"^(\d{4})\D?(0[1-9]|1[0-2])\D?([12]\d|0[1-9]|3[01])$")
if not exp.match(beg_date):
raise ScoValueError("invalid date: %s" % beg_date)
diff --git a/app/views/notes.py b/app/views/notes.py
index 0da9f18e2..307c8b69a 100644
--- a/app/views/notes.py
+++ b/app/views/notes.py
@@ -671,7 +671,7 @@ def formsemestre_custommenu_edit(REQUEST, formsemestre_id):
@scodoc7func
def edit_enseignants_form(REQUEST, moduleimpl_id):
"modif liste enseignants/moduleimpl"
- M, sem = sco_moduleimpl.can_change_ens(REQUEST, moduleimpl_id)
+ M, sem = sco_moduleimpl.can_change_ens(moduleimpl_id)
# --
header = html_sco_header.html_sem_header(
REQUEST,
@@ -915,7 +915,7 @@ def edit_moduleimpl_expr(REQUEST, moduleimpl_id):
"""Edition formule calcul moyenne module
Accessible par Admin, dir des etud et responsable module
"""
- M, sem = sco_moduleimpl.can_change_ens(REQUEST, moduleimpl_id)
+ M, sem = sco_moduleimpl.can_change_ens(moduleimpl_id)
H = [
html_sco_header.html_sem_header(
REQUEST,
@@ -1230,12 +1230,12 @@ def formsemestre_enseignants_list(REQUEST, formsemestre_id, format="html"):
@scodoc
@permission_required(Permission.ScoView)
@scodoc7func
-def edit_enseignants_form_delete(REQUEST, moduleimpl_id, ens_id: int):
+def edit_enseignants_form_delete(moduleimpl_id, ens_id: int):
"""remove ens from this modueimpl
ens_id: user.id
"""
- M, _ = sco_moduleimpl.can_change_ens(REQUEST, moduleimpl_id)
+ M, _ = sco_moduleimpl.can_change_ens(moduleimpl_id)
# search ens_id
ok = False
for ens in M["ens"]:
@@ -1319,7 +1319,7 @@ def formsemestre_desinscription(
% (etudid, formsemestre_id)
)
if not dialog_confirmed:
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1)[0]
+ etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
if sem["modalite"] != "EXT":
msg_ext = """
%s sera désinscrit de tous les modules du semestre %s (%s - %s).
@@ -1867,7 +1867,7 @@ def appreciation_add_form(
logdb(cnx, method="appreciation_suppress", etudid=etudid, msg="")
return flask.redirect(bull_url)
#
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1)[0]
+ etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
if id:
a = "Edition"
else:
@@ -2144,7 +2144,7 @@ def formsemestre_validation_suppress_etud(
)
if not dialog_confirmed:
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1)[0]
+ etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
nt = sco_cache.NotesTableCache.get(formsemestre_id) # > get_etud_decision_sem
decision_jury = nt.get_etud_decision_sem(etudid)
if decision_jury:
diff --git a/app/views/scolar.py b/app/views/scolar.py
index 6c4aa4cca..917e65ebd 100644
--- a/app/views/scolar.py
+++ b/app/views/scolar.py
@@ -34,7 +34,6 @@ Emmanuel Viennet, 2021
import sys
import time
-# StringIO => io.StringIO or io.BytesIO for text and data respectively. #py3
from io import StringIO
from zipfile import ZipFile
@@ -134,7 +133,7 @@ log("ScoDoc8 restarting...")
@scodoc
@permission_required(Permission.ScoView)
@scodoc7func
-def about(REQUEST):
+def about():
"version info"
H = [
"""Système de gestion scolarité
@@ -180,18 +179,19 @@ def edit_preferences(REQUEST):
@scodoc7func
def formsemestre_edit_preferences(formsemestre_id, REQUEST):
"""Edit preferences for a semestre"""
- authuser = REQUEST.AUTHENTICATED_USER
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
ok = (
- authuser.has_permission(Permission.ScoImplement)
- or ((str(authuser) in sem["responsables"]) and sem["resp_can_edit"])
+ current_user.has_permission(Permission.ScoImplement)
+ or ((current_user.id in sem["responsables"]) and sem["resp_can_edit"])
) and (sem["etat"])
if ok:
return sco_preferences.SemPreferences(formsemestre_id=formsemestre_id).edit(
REQUEST=REQUEST
)
else:
- raise AccessDenied("Modification impossible pour %s" % authuser)
+ raise AccessDenied(
+ "Modification impossible pour %s" % current_user.get_nomplogin()
+ )
@bp.route("/doc_preferences")
@@ -217,7 +217,7 @@ def doc_preferences(REQUEST):
@scodoc7func
def showEtudLog(etudid, format="html", REQUEST=None):
"""Display log of operations on this student"""
- etud = sco_etud.get_etud_info(filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True)[0]
ops = sco_etud.list_scolog(etudid)
@@ -309,9 +309,7 @@ def getEtudInfo(etudid=False, code_nip=False, filled=False, REQUEST=None, format
ou bien cherche dans REQUEST.form: etudid, code_nip, code_ine
(dans cet ordre).
"""
- etud = sco_etud.get_etud_info(
- etudid=etudid, code_nip=code_nip, filled=filled, REQUEST=REQUEST
- )
+ etud = sco_etud.get_etud_info(etudid=etudid, code_nip=code_nip, filled=filled)
if format is None:
return etud
else:
@@ -339,7 +337,7 @@ sco_publish(
def etud_info(etudid=None, format="xml", REQUEST=None):
"Donne les informations sur un etudiant"
t0 = time.time()
- args = sco_etud.make_etud_args(etudid=etudid, REQUEST=REQUEST)
+ args = sco_etud.make_etud_args(etudid=etudid)
cnx = ndb.GetDBConnexion()
etuds = sco_etud.etudident_list(cnx, args)
if not etuds:
@@ -562,7 +560,7 @@ def doSuppressAnnotation(etudid, annotation_id, REQUEST):
def formChangeCoordonnees(etudid, REQUEST):
"edit coordonnees etudiant"
cnx = ndb.GetDBConnexion()
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
adrs = sco_etud.adresse_list(cnx, {"etudid": etudid})
if adrs:
adr = adrs[0]
@@ -747,7 +745,7 @@ sco_publish("/etud_photo_html", sco_photos.etud_photo_html, Permission.ScoView)
@scodoc7func
def etud_photo_orig_page(etudid=None, REQUEST=None):
"Page with photo in orig. size"
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
H = [
html_sco_header.sco_header(page_title=etud["nomprenom"]),
"%s" % etud["nomprenom"],
@@ -766,7 +764,7 @@ def etud_photo_orig_page(etudid=None, REQUEST=None):
@scodoc7func
def formChangePhoto(etudid=None, REQUEST=None):
"""Formulaire changement photo étudiant"""
- etud = sco_etud.get_etud_info(filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True)[0]
if sco_photos.etud_photo_is_local(etud):
etud["photoloc"] = "dans ScoDoc"
else:
@@ -824,7 +822,7 @@ def formChangePhoto(etudid=None, REQUEST=None):
@scodoc7func
def formSuppressPhoto(etudid=None, REQUEST=None, dialog_confirmed=False):
"""Formulaire suppression photo étudiant"""
- etud = sco_etud.get_etud_info(filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True)[0]
if not dialog_confirmed:
return scu.confirm_dialog(
"Confirmer la suppression de la photo de %(nomprenom)s ? " % etud,
@@ -881,7 +879,7 @@ def _formDem_of_Def(
operation_method="",
):
"Formulaire démission ou défaillance Etudiant"
- etud = sco_etud.get_etud_info(etudid=etudid, filled=1, REQUEST=REQUEST)[0]
+ etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
if not sem["etat"]:
raise ScoValueError("Modification impossible: semestre verrouille")
diff --git a/app/views/users.py b/app/views/users.py
index 01c30277d..7238da64b 100644
--- a/app/views/users.py
+++ b/app/views/users.py
@@ -84,7 +84,7 @@ def index_html(REQUEST, all_depts=False, with_inactives=False, format="html"):
@permission_required(Permission.ScoUsersView)
@scodoc7func
def user_info(user_name, format="json", REQUEST=None):
- info = sco_users.user_info(user_name=user_name)
+ info = sco_users.user_info(user_name)
return scu.sendResult(REQUEST, info, name="user", format=format)
|