2020-09-26 16:19:37 +02:00
|
|
|
# -*- mode: python -*-
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
#
|
|
|
|
# Gestion scolarite IUT
|
|
|
|
#
|
2023-01-02 13:16:27 +01:00
|
|
|
# Copyright (c) 1999 - 2023 Emmanuel Viennet. All rights reserved.
|
2020-09-26 16:19:37 +02:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
# Emmanuel Viennet emmanuel.viennet@viennet.net
|
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
"""Ajout/Modification/Supression matieres
|
|
|
|
(portage from DTML)
|
|
|
|
"""
|
2021-08-01 10:16:16 +02:00
|
|
|
import flask
|
2021-09-18 10:10:02 +02:00
|
|
|
from flask import g, url_for, request
|
2022-04-12 17:12:51 +02:00
|
|
|
from app.models.events import ScolarNews
|
2022-01-04 20:03:38 +01:00
|
|
|
from app.models.formations import Matiere
|
2021-08-01 10:16:16 +02:00
|
|
|
|
2021-06-19 23:21:37 +02:00
|
|
|
import app.scodoc.notesdb as ndb
|
|
|
|
import app.scodoc.sco_utils as scu
|
2021-08-29 19:57:32 +02:00
|
|
|
from app import log
|
2021-12-16 16:27:35 +01:00
|
|
|
from app.models import Formation
|
2021-06-19 23:21:37 +02:00
|
|
|
from app.scodoc.TrivialFormulator import TrivialFormulator, tf_error_message
|
2022-01-04 20:03:38 +01:00
|
|
|
from app.scodoc.sco_exceptions import (
|
|
|
|
ScoValueError,
|
|
|
|
ScoLockedFormError,
|
|
|
|
ScoNonEmptyFormationObject,
|
|
|
|
)
|
2021-06-19 23:21:37 +02:00
|
|
|
from app.scodoc import html_sco_header
|
2020-09-26 16:19:37 +02:00
|
|
|
|
2021-06-16 18:18:32 +02:00
|
|
|
_matiereEditor = ndb.EditableTable(
|
|
|
|
"notes_matieres",
|
|
|
|
"matiere_id",
|
|
|
|
("matiere_id", "ue_id", "numero", "titre"),
|
|
|
|
sortkey="numero",
|
|
|
|
output_formators={"numero": ndb.int_null_is_zero},
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2021-10-17 23:19:26 +02:00
|
|
|
def matiere_list(*args, **kw):
|
2021-06-16 18:18:32 +02:00
|
|
|
"list matieres"
|
|
|
|
cnx = ndb.GetDBConnexion()
|
|
|
|
return _matiereEditor.list(cnx, *args, **kw)
|
|
|
|
|
|
|
|
|
2021-08-20 01:09:55 +02:00
|
|
|
def do_matiere_edit(*args, **kw):
|
2021-06-16 18:18:32 +02:00
|
|
|
"edit a matiere"
|
2021-07-19 19:53:01 +02:00
|
|
|
from app.scodoc import sco_edit_ue
|
|
|
|
from app.scodoc import sco_edit_formation
|
|
|
|
|
2021-06-16 18:18:32 +02:00
|
|
|
cnx = ndb.GetDBConnexion()
|
|
|
|
# check
|
2021-10-17 23:19:26 +02:00
|
|
|
mat = matiere_list({"matiere_id": args[0]["matiere_id"]})[0]
|
2021-08-20 01:09:55 +02:00
|
|
|
if matiere_is_locked(mat["matiere_id"]):
|
2021-06-16 18:18:32 +02:00
|
|
|
raise ScoLockedFormError()
|
|
|
|
# edit
|
|
|
|
_matiereEditor.edit(cnx, *args, **kw)
|
2021-10-17 23:19:26 +02:00
|
|
|
formation_id = sco_edit_ue.ue_list({"ue_id": mat["ue_id"]})[0]["formation_id"]
|
2021-12-16 16:27:35 +01:00
|
|
|
Formation.query.get(formation_id).invalidate_cached_sems()
|
2021-06-16 18:18:32 +02:00
|
|
|
|
|
|
|
|
2021-08-20 01:09:55 +02:00
|
|
|
def do_matiere_create(args):
|
2021-06-16 18:18:32 +02:00
|
|
|
"create a matiere"
|
2021-06-19 23:21:37 +02:00
|
|
|
from app.scodoc import sco_edit_ue
|
2022-04-12 17:12:51 +02:00
|
|
|
from app.models import ScolarNews
|
2021-06-19 23:21:37 +02:00
|
|
|
|
2021-06-16 18:18:32 +02:00
|
|
|
cnx = ndb.GetDBConnexion()
|
|
|
|
# check
|
2021-10-17 23:19:26 +02:00
|
|
|
ue = sco_edit_ue.ue_list({"ue_id": args["ue_id"]})[0]
|
2021-06-16 18:18:32 +02:00
|
|
|
# create matiere
|
|
|
|
r = _matiereEditor.create(cnx, args)
|
|
|
|
|
|
|
|
# news
|
2022-02-14 18:33:36 +01:00
|
|
|
formation = Formation.query.get(ue["formation_id"])
|
2022-04-12 17:12:51 +02:00
|
|
|
ScolarNews.add(
|
|
|
|
typ=ScolarNews.NEWS_FORM,
|
|
|
|
obj=ue["formation_id"],
|
2022-03-15 10:57:52 +01:00
|
|
|
text=f"Modification de la formation {formation.acronyme}",
|
2022-04-13 00:32:31 +02:00
|
|
|
max_frequency=10 * 60,
|
2021-06-16 18:18:32 +02:00
|
|
|
)
|
2022-02-14 18:33:36 +01:00
|
|
|
formation.invalidate_cached_sems()
|
2021-06-16 18:18:32 +02:00
|
|
|
return r
|
|
|
|
|
2020-09-26 16:19:37 +02:00
|
|
|
|
2021-09-27 10:20:10 +02:00
|
|
|
def matiere_create(ue_id=None):
|
2021-01-01 18:40:47 +01:00
|
|
|
"""Creation d'une matiere"""
|
2021-06-19 23:21:37 +02:00
|
|
|
from app.scodoc import sco_edit_ue
|
|
|
|
|
2021-10-17 23:19:26 +02:00
|
|
|
UE = sco_edit_ue.ue_list(args={"ue_id": ue_id})[0]
|
2020-09-26 16:19:37 +02:00
|
|
|
H = [
|
2021-07-29 16:31:15 +02:00
|
|
|
html_sco_header.sco_header(page_title="Création d'une matière"),
|
2020-09-26 16:19:37 +02:00
|
|
|
"""<h2>Création d'une matière dans l'UE %(titre)s (%(acronyme)s)</h2>""" % UE,
|
|
|
|
"""<p class="help">Les matières sont des groupes de modules dans une UE
|
|
|
|
d'une formation donnée. Les matières servent surtout pour la
|
|
|
|
présentation (bulletins, etc) mais <em>n'ont pas de rôle dans le calcul
|
|
|
|
des notes.</em>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="help">Si votre formation n'utilise pas la notion de
|
|
|
|
"matières", créez une matière par UE, et donnez lui le même nom que l'UE
|
|
|
|
(en effet, tout module doit appartenir à une matière).
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="help">Comme les UE, les matières n'ont pas de coefficient
|
|
|
|
associé.
|
|
|
|
</p>""",
|
|
|
|
]
|
|
|
|
tf = TrivialFormulator(
|
2021-09-18 10:10:02 +02:00
|
|
|
request.base_url,
|
2021-09-27 16:42:14 +02:00
|
|
|
scu.get_request_args(),
|
2020-09-26 16:19:37 +02:00
|
|
|
(
|
|
|
|
("ue_id", {"input_type": "hidden", "default": ue_id}),
|
|
|
|
("titre", {"size": 30, "explanation": "nom de la matière."}),
|
|
|
|
(
|
|
|
|
"numero",
|
|
|
|
{
|
|
|
|
"size": 2,
|
|
|
|
"explanation": "numéro (1,2,3,4...) pour affichage",
|
|
|
|
"type": "int",
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
submitlabel="Créer cette matière",
|
|
|
|
)
|
|
|
|
|
2021-08-09 10:09:04 +02:00
|
|
|
dest_url = url_for(
|
2021-10-17 23:19:26 +02:00
|
|
|
"notes.ue_table", scodoc_dept=g.scodoc_dept, formation_id=UE["formation_id"]
|
2021-08-09 10:09:04 +02:00
|
|
|
)
|
2020-09-26 16:19:37 +02:00
|
|
|
|
|
|
|
if tf[0] == 0:
|
2021-07-29 10:19:00 +02:00
|
|
|
return "\n".join(H) + tf[1] + html_sco_header.sco_footer()
|
2020-09-26 16:19:37 +02:00
|
|
|
elif tf[0] == -1:
|
2021-07-31 18:01:10 +02:00
|
|
|
return flask.redirect(dest_url)
|
2020-09-26 16:19:37 +02:00
|
|
|
else:
|
|
|
|
# check unicity
|
2021-10-17 23:19:26 +02:00
|
|
|
mats = matiere_list(args={"ue_id": ue_id, "titre": tf[2]["titre"]})
|
2020-09-26 16:19:37 +02:00
|
|
|
if mats:
|
|
|
|
return (
|
|
|
|
"\n".join(H)
|
|
|
|
+ tf_error_message("Titre de matière déjà existant dans cette UE")
|
|
|
|
+ tf[1]
|
2021-07-29 10:19:00 +02:00
|
|
|
+ html_sco_header.sco_footer()
|
2020-09-26 16:19:37 +02:00
|
|
|
)
|
2021-08-20 01:09:55 +02:00
|
|
|
_ = do_matiere_create(tf[2])
|
2021-07-31 18:01:10 +02:00
|
|
|
return flask.redirect(dest_url)
|
2020-09-26 16:19:37 +02:00
|
|
|
|
|
|
|
|
2022-01-04 20:03:38 +01:00
|
|
|
def can_delete_matiere(matiere: Matiere) -> tuple[bool, str]:
|
|
|
|
"True si la matiere n'est pas utilisée dans des formsemestre"
|
|
|
|
locked = matiere_is_locked(matiere.id)
|
|
|
|
if locked:
|
|
|
|
return False
|
|
|
|
if any(m.modimpls.all() for m in matiere.modules):
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
2021-08-20 01:09:55 +02:00
|
|
|
def do_matiere_delete(oid):
|
2021-06-16 18:18:32 +02:00
|
|
|
"delete matiere and attached modules"
|
2021-06-19 23:21:37 +02:00
|
|
|
from app.scodoc import sco_edit_ue
|
|
|
|
from app.scodoc import sco_edit_module
|
|
|
|
|
2021-06-16 18:18:32 +02:00
|
|
|
cnx = ndb.GetDBConnexion()
|
|
|
|
# check
|
2022-01-04 20:03:38 +01:00
|
|
|
matiere = Matiere.query.get_or_404(oid)
|
|
|
|
mat = matiere_list({"matiere_id": oid})[0] # compat sco7
|
2021-10-17 23:19:26 +02:00
|
|
|
ue = sco_edit_ue.ue_list({"ue_id": mat["ue_id"]})[0]
|
2022-01-04 20:03:38 +01:00
|
|
|
if not can_delete_matiere(matiere):
|
|
|
|
# il y a au moins un modimpl dans un module de cette matière
|
|
|
|
raise ScoNonEmptyFormationObject("Matière", matiere.titre)
|
|
|
|
|
|
|
|
log("do_matiere_delete: matiere_id=%s" % matiere.id)
|
2021-06-16 18:18:32 +02:00
|
|
|
# delete all modules in this matiere
|
2022-01-04 20:03:38 +01:00
|
|
|
mods = sco_edit_module.module_list({"matiere_id": matiere.id})
|
2021-06-16 18:18:32 +02:00
|
|
|
for mod in mods:
|
2021-08-20 01:09:55 +02:00
|
|
|
sco_edit_module.do_module_delete(mod["module_id"])
|
2021-06-16 18:18:32 +02:00
|
|
|
_matiereEditor.delete(cnx, oid)
|
|
|
|
|
|
|
|
# news
|
2022-02-14 18:33:36 +01:00
|
|
|
formation = Formation.query.get(ue["formation_id"])
|
2022-04-12 17:12:51 +02:00
|
|
|
ScolarNews.add(
|
|
|
|
typ=ScolarNews.NEWS_FORM,
|
|
|
|
obj=ue["formation_id"],
|
2022-03-15 10:57:52 +01:00
|
|
|
text=f"Modification de la formation {formation.acronyme}",
|
2022-04-13 00:32:31 +02:00
|
|
|
max_frequency=10 * 60,
|
2021-06-16 18:18:32 +02:00
|
|
|
)
|
2022-02-14 18:33:36 +01:00
|
|
|
formation.invalidate_cached_sems()
|
2021-06-16 18:18:32 +02:00
|
|
|
|
|
|
|
|
2021-09-27 10:20:10 +02:00
|
|
|
def matiere_delete(matiere_id=None):
|
2021-10-22 23:09:15 +02:00
|
|
|
"""Delete matière"""
|
2021-06-19 23:21:37 +02:00
|
|
|
from app.scodoc import sco_edit_ue
|
|
|
|
|
2022-01-04 20:03:38 +01:00
|
|
|
matiere = Matiere.query.get_or_404(matiere_id)
|
|
|
|
if not can_delete_matiere(matiere):
|
|
|
|
# il y a au moins un modimpl dans un module de cette matière
|
|
|
|
raise ScoNonEmptyFormationObject(
|
|
|
|
"Matière",
|
|
|
|
matiere.titre,
|
|
|
|
dest_url=url_for(
|
|
|
|
"notes.ue_table",
|
|
|
|
formation_id=matiere.ue.formation_id,
|
|
|
|
semestre_idx=matiere.ue.semestre_idx,
|
|
|
|
scodoc_dept=g.scodoc_dept,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
mat = matiere_list(args={"matiere_id": matiere_id})[0]
|
|
|
|
UE = sco_edit_ue.ue_list(args={"ue_id": mat["ue_id"]})[0]
|
2020-09-26 16:19:37 +02:00
|
|
|
H = [
|
2021-07-29 16:31:15 +02:00
|
|
|
html_sco_header.sco_header(page_title="Suppression d'une matière"),
|
2022-01-04 20:03:38 +01:00
|
|
|
"<h2>Suppression de la matière %(titre)s" % mat,
|
2020-09-26 16:19:37 +02:00
|
|
|
" dans l'UE (%(acronyme)s))</h2>" % UE,
|
|
|
|
]
|
2021-10-22 23:09:15 +02:00
|
|
|
dest_url = url_for(
|
|
|
|
"notes.ue_table",
|
|
|
|
scodoc_dept=g.scodoc_dept,
|
|
|
|
formation_id=str(UE["formation_id"]),
|
|
|
|
)
|
2020-09-26 16:19:37 +02:00
|
|
|
tf = TrivialFormulator(
|
2021-09-18 10:10:02 +02:00
|
|
|
request.base_url,
|
2021-09-27 16:42:14 +02:00
|
|
|
scu.get_request_args(),
|
2020-09-26 16:19:37 +02:00
|
|
|
(("matiere_id", {"input_type": "hidden"}),),
|
2022-01-04 20:03:38 +01:00
|
|
|
initvalues=mat,
|
2020-09-26 16:19:37 +02:00
|
|
|
submitlabel="Confirmer la suppression",
|
|
|
|
cancelbutton="Annuler",
|
|
|
|
)
|
|
|
|
if tf[0] == 0:
|
2021-07-29 10:19:00 +02:00
|
|
|
return "\n".join(H) + tf[1] + html_sco_header.sco_footer()
|
2020-09-26 16:19:37 +02:00
|
|
|
elif tf[0] == -1:
|
2021-07-31 18:01:10 +02:00
|
|
|
return flask.redirect(dest_url)
|
2020-09-26 16:19:37 +02:00
|
|
|
else:
|
2021-08-20 01:09:55 +02:00
|
|
|
do_matiere_delete(matiere_id)
|
2021-07-31 18:01:10 +02:00
|
|
|
return flask.redirect(dest_url)
|
2020-09-26 16:19:37 +02:00
|
|
|
|
|
|
|
|
2021-09-27 10:20:10 +02:00
|
|
|
def matiere_edit(matiere_id=None):
|
2020-09-26 16:19:37 +02:00
|
|
|
"""Edit matiere"""
|
2021-06-19 23:21:37 +02:00
|
|
|
from app.scodoc import sco_formations
|
|
|
|
from app.scodoc import sco_edit_ue
|
|
|
|
|
2021-10-17 23:19:26 +02:00
|
|
|
F = matiere_list(args={"matiere_id": matiere_id})
|
2020-09-26 16:19:37 +02:00
|
|
|
if not F:
|
|
|
|
raise ScoValueError("Matière inexistante !")
|
|
|
|
F = F[0]
|
2021-10-22 23:09:15 +02:00
|
|
|
ues = sco_edit_ue.ue_list(args={"ue_id": F["ue_id"]})
|
|
|
|
if not ues:
|
2020-09-26 16:19:37 +02:00
|
|
|
raise ScoValueError("UE inexistante !")
|
2021-10-22 23:09:15 +02:00
|
|
|
ue = ues[0]
|
|
|
|
Fo = sco_formations.formation_list(args={"formation_id": ue["formation_id"]})[0]
|
2020-09-26 16:19:37 +02:00
|
|
|
|
2021-10-22 23:09:15 +02:00
|
|
|
ues = sco_edit_ue.ue_list(args={"formation_id": ue["formation_id"]})
|
2020-09-26 16:19:37 +02:00
|
|
|
ue_names = ["%(acronyme)s (%(titre)s)" % u for u in ues]
|
|
|
|
ue_ids = [u["ue_id"] for u in ues]
|
|
|
|
H = [
|
2021-07-29 16:31:15 +02:00
|
|
|
html_sco_header.sco_header(page_title="Modification d'une matière"),
|
2020-09-26 16:19:37 +02:00
|
|
|
"""<h2>Modification de la matière %(titre)s""" % F,
|
|
|
|
"""(formation %(acronyme)s, version %(version)s)</h2>""" % Fo,
|
|
|
|
]
|
|
|
|
help = """<p class="help">Les matières sont des groupes de modules dans une UE
|
|
|
|
d'une formation donnée. Les matières servent surtout pour la
|
|
|
|
présentation (bulletins, etc) mais <em>n'ont pas de rôle dans le calcul
|
|
|
|
des notes.</em>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="help">Si votre formation n'utilise pas la notion de
|
|
|
|
"matières", créez une matière par UE, et donnez lui le même nom que l'UE
|
|
|
|
(en effet, tout module doit appartenir à une matière).
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p class="help">Comme les UE, les matières n'ont pas de coefficient
|
|
|
|
associé.
|
|
|
|
</p>"""
|
|
|
|
tf = TrivialFormulator(
|
2021-09-18 10:10:02 +02:00
|
|
|
request.base_url,
|
2021-09-27 16:42:14 +02:00
|
|
|
scu.get_request_args(),
|
2020-09-26 16:19:37 +02:00
|
|
|
(
|
|
|
|
("matiere_id", {"input_type": "hidden"}),
|
|
|
|
(
|
|
|
|
"ue_id",
|
2022-09-23 11:23:48 +02:00
|
|
|
{
|
|
|
|
"input_type": "menu",
|
|
|
|
"allowed_values": ue_ids,
|
|
|
|
"labels": ue_names,
|
|
|
|
"title": "UE",
|
|
|
|
},
|
2020-09-26 16:19:37 +02:00
|
|
|
),
|
|
|
|
("titre", {"size": 30, "explanation": "nom de cette matière"}),
|
|
|
|
(
|
|
|
|
"numero",
|
|
|
|
{
|
|
|
|
"size": 2,
|
|
|
|
"explanation": "numéro (1,2,3,4...) pour affichage",
|
|
|
|
"type": "int",
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
initvalues=F,
|
|
|
|
submitlabel="Modifier les valeurs",
|
|
|
|
)
|
|
|
|
|
2021-10-22 23:09:15 +02:00
|
|
|
dest_url = url_for(
|
|
|
|
"notes.ue_table",
|
|
|
|
scodoc_dept=g.scodoc_dept,
|
|
|
|
formation_id=str(ue["formation_id"]),
|
|
|
|
)
|
2020-09-26 16:19:37 +02:00
|
|
|
if tf[0] == 0:
|
2021-07-29 10:19:00 +02:00
|
|
|
return "\n".join(H) + tf[1] + help + html_sco_header.sco_footer()
|
2020-09-26 16:19:37 +02:00
|
|
|
elif tf[0] == -1:
|
2021-07-31 18:01:10 +02:00
|
|
|
return flask.redirect(dest_url)
|
2020-09-26 16:19:37 +02:00
|
|
|
else:
|
|
|
|
# check unicity
|
2021-10-17 23:19:26 +02:00
|
|
|
mats = matiere_list(args={"ue_id": tf[2]["ue_id"], "titre": tf[2]["titre"]})
|
2020-09-26 16:19:37 +02:00
|
|
|
if len(mats) > 1 or (len(mats) == 1 and mats[0]["matiere_id"] != matiere_id):
|
|
|
|
return (
|
|
|
|
"\n".join(H)
|
|
|
|
+ tf_error_message("Titre de matière déjà existant dans cette UE")
|
|
|
|
+ tf[1]
|
2021-07-29 10:19:00 +02:00
|
|
|
+ html_sco_header.sco_footer()
|
2020-09-26 16:19:37 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# changement d'UE ?
|
|
|
|
if tf[2]["ue_id"] != F["ue_id"]:
|
|
|
|
log("attaching mat %s to new UE %s" % (matiere_id, tf[2]["ue_id"]))
|
2021-02-03 22:00:41 +01:00
|
|
|
ndb.SimpleQuery(
|
2020-09-26 16:19:37 +02:00
|
|
|
"UPDATE notes_modules SET ue_id = %(ue_id)s WHERE matiere_id=%(matiere_id)s",
|
|
|
|
{"ue_id": tf[2]["ue_id"], "matiere_id": matiere_id},
|
|
|
|
)
|
|
|
|
|
2021-08-20 01:09:55 +02:00
|
|
|
do_matiere_edit(tf[2])
|
2020-09-26 16:19:37 +02:00
|
|
|
|
2021-07-31 18:01:10 +02:00
|
|
|
return flask.redirect(dest_url)
|
2021-06-13 19:12:20 +02:00
|
|
|
|
|
|
|
|
2021-08-20 01:09:55 +02:00
|
|
|
def matiere_is_locked(matiere_id):
|
2021-06-13 19:12:20 +02:00
|
|
|
"""True if matiere should not be modified
|
|
|
|
(contains modules used in a locked formsemestre)
|
|
|
|
"""
|
|
|
|
r = ndb.SimpleDictFetch(
|
2021-08-08 17:38:46 +02:00
|
|
|
"""SELECT ma.id
|
|
|
|
FROM notes_matieres ma, notes_modules mod, notes_formsemestre sem, notes_moduleimpl mi
|
|
|
|
WHERE ma.id = mod.matiere_id
|
|
|
|
AND mi.module_id = mod.id
|
|
|
|
AND mi.formsemestre_id = sem.id
|
2021-08-09 10:09:04 +02:00
|
|
|
AND ma.id = %(matiere_id)s
|
2021-08-08 17:38:46 +02:00
|
|
|
AND sem.etat = false
|
2021-06-13 19:12:20 +02:00
|
|
|
""",
|
|
|
|
{"matiere_id": matiere_id},
|
|
|
|
)
|
2021-09-18 10:10:02 +02:00
|
|
|
return len(r) > 0
|