Skip to content
Snippets Groups Projects
Commit 553770f4 authored by Emmanuel Viennet's avatar Emmanuel Viennet
Browse files

Fix: affichage coef. APC et version

parent 8a4b26d2
No related branches found
No related tags found
No related merge requests found
...@@ -590,9 +590,7 @@ class ResultatsSemestre(ResultatsCache): ...@@ -590,9 +590,7 @@ class ResultatsSemestre(ResultatsCache):
if modimpl.id in modimpl_ids: if modimpl.id in modimpl_ids:
col_id = f"moy_{modimpl.module.type_abbrv()}_{modimpl.id}_{ue.id}" col_id = f"moy_{modimpl.module.type_abbrv()}_{modimpl.id}_{ue.id}"
if self.is_apc: if self.is_apc:
coef = self.modimpl_coefs_df[modimpl.id][ue.id] * ( coef = self.modimpl_coefs_df[modimpl.id][ue.id]
modimpl.module.coefficient or 0.0
)
else: else:
coef = modimpl.module.coefficient or 0 coef = modimpl.module.coefficient or 0
bottom_infos["coef"][col_id] = fmt_note(coef) bottom_infos["coef"][col_id] = fmt_note(coef)
......
...@@ -72,13 +72,10 @@ class NotesNotesLog(db.Model): ...@@ -72,13 +72,10 @@ class NotesNotesLog(db.Model):
def etud_has_notes_attente(etudid, formsemestre_id): def etud_has_notes_attente(etudid, formsemestre_id):
"""Vrai si cet etudiant a au moins une note en attente dans ce semestre. """Vrai si cet etudiant a au moins une note en attente dans ce semestre.
(ne compte que les notes en attente dans des évaluation avec coef. non nul). (ne compte que les notes en attente dans des évaluations avec coef. non nul).
""" """
# XXX ancienne méthode de notes_table à ré-écrire cursor = db.session.execute(
cnx = ndb.GetDBConnexion() """SELECT COUNT(*)
cursor = cnx.cursor(cursor_factory=ndb.ScoDocCursor)
cursor.execute(
"""SELECT n.*
FROM notes_notes n, notes_evaluation e, notes_moduleimpl m, FROM notes_notes n, notes_evaluation e, notes_moduleimpl m,
notes_moduleimpl_inscription i notes_moduleimpl_inscription i
WHERE n.etudid = %(etudid)s WHERE n.etudid = %(etudid)s
...@@ -96,4 +93,4 @@ def etud_has_notes_attente(etudid, formsemestre_id): ...@@ -96,4 +93,4 @@ def etud_has_notes_attente(etudid, formsemestre_id):
"code_attente": scu.NOTES_ATTENTE, "code_attente": scu.NOTES_ATTENTE,
}, },
) )
return len(cursor.fetchall()) > 0 return cursor.fetchone()[0] > 0
...@@ -520,7 +520,7 @@ def module_edit(module_id=None): ...@@ -520,7 +520,7 @@ def module_edit(module_id=None):
H = [ H = [
html_sco_header.sco_header( html_sco_header.sco_header(
page_title="Modification du module %(titre)s" % module, page_title=f"Modification du module {a_module.code or a_module.titre or ''}",
cssstyles=["libjs/jQuery-tagEditor/jquery.tag-editor.css"], cssstyles=["libjs/jQuery-tagEditor/jquery.tag-editor.css"],
javascripts=[ javascripts=[
"libjs/jQuery-tagEditor/jquery.tag-editor.min.js", "libjs/jQuery-tagEditor/jquery.tag-editor.min.js",
...@@ -528,7 +528,7 @@ def module_edit(module_id=None): ...@@ -528,7 +528,7 @@ def module_edit(module_id=None):
"js/module_tag_editor.js", "js/module_tag_editor.js",
], ],
), ),
"""<h2>Modification du module %(titre)s""" % module, f"""<h2>Modification du module {a_module.code or ''} {a_module.titre or ''}""",
""" (formation %(acronyme)s, version %(version)s)</h2>""" % formation, """ (formation %(acronyme)s, version %(version)s)</h2>""" % formation,
render_template( render_template(
"scodoc/help/modules.html", "scodoc/help/modules.html",
......
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.2.87" SCOVERSION = "9.1.87"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment