This commit is contained in:
Emmanuel Viennet 2021-08-15 22:41:47 +02:00
parent b0362be18b
commit e1dad774be
2 changed files with 13 additions and 3 deletions

View File

@ -41,7 +41,7 @@ class NotesUE(db.Model):
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
ue_id = db.synonym("id") ue_id = db.synonym("id")
formation_id = db.Column(db.Integer, db.ForeignKey("notes_formations.id")) formation_id = db.Column(db.Integer, db.ForeignKey("notes_formations.id"))
acronyme = db.Column(db.Text()), nullable=False) acronyme = db.Column(db.Text(), nullable=False)
numero = db.Column(db.Integer) # ordre de présentation numero = db.Column(db.Integer) # ordre de présentation
titre = db.Column(db.Text()) titre = db.Column(db.Text())
# Type d'UE: 0 normal ("fondamentale"), 1 "sport", 2 "projet et stage (LP)", # Type d'UE: 0 normal ("fondamentale"), 1 "sport", 2 "projet et stage (LP)",

View File

@ -1151,10 +1151,20 @@ def formsemestre_enseignants_list(context, REQUEST, formsemestre_id, format="htm
cnx = ndb.GetDBConnexion() cnx = ndb.GetDBConnexion()
cursor = cnx.cursor(cursor_factory=ndb.ScoDocCursor) cursor = cnx.cursor(cursor_factory=ndb.ScoDocCursor)
for ens in sem_ens: for ens in sem_ens:
u = User.query.filter_by(id=ens).first()
if not u:
continue
cursor.execute( cursor.execute(
"select * from scolog L, notes_formsemestre_inscription I where method='AddAbsence' and authenticated_user=%(authenticated_user)s and L.etudid = I.etudid and I.formsemestre_id=%(formsemestre_id)s and date > %(date_debut)s and date < %(date_fin)s", """SELECT * FROM scolog L, notes_formsemestre_inscription I
WHERE method = 'AddAbsence'
and authenticated_user = %(authenticated_user)s
and L.etudid = I.etudid
and I.formsemestre_id = %(formsemestre_id)s
and date > %(date_debut)s
and date < %(date_fin)s
""",
{ {
"authenticated_user": ens, "authenticated_user": u.user_name,
"formsemestre_id": formsemestre_id, "formsemestre_id": formsemestre_id,
"date_debut": ndb.DateDMYtoISO(sem["date_debut"]), "date_debut": ndb.DateDMYtoISO(sem["date_debut"]),
"date_fin": ndb.DateDMYtoISO(sem["date_fin"]), "date_fin": ndb.DateDMYtoISO(sem["date_fin"]),