From 8aba6d6632895c2fbe5b3960e4c3b54a6c327d88 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 27 Jan 2022 11:53:16 +0100 Subject: [PATCH 1/2] Fix: do_etud_inscrit_ue --- app/scodoc/sco_moduleimpl_inscriptions.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/scodoc/sco_moduleimpl_inscriptions.py b/app/scodoc/sco_moduleimpl_inscriptions.py index baf5de70b..8cd7e5e99 100644 --- a/app/scodoc/sco_moduleimpl_inscriptions.py +++ b/app/scodoc/sco_moduleimpl_inscriptions.py @@ -565,17 +565,17 @@ def do_etud_inscrit_ue(etudid, formsemestre_id, ue_id): cnx = ndb.GetDBConnexion() cursor = cnx.cursor(cursor_factory=ndb.ScoDocCursor) cursor.execute( - """SELECT mi.moduleimpl_id + """SELECT mi.id FROM notes_moduleimpl mi, notes_modules mod, notes_formsemestre sem - WHERE sem.formsemestre_id = %(formsemestre_id)s - AND mi.formsemestre_id = sem.formsemestre_id - AND mod.module_id = mi.module_id + WHERE sem.id = %(formsemestre_id)s + AND mi.formsemestre_id = sem.id + AND mod.id = mi.module_id AND mod.ue_id = %(ue_id)s """, {"formsemestre_id": formsemestre_id, "ue_id": ue_id}, ) res = cursor.dictfetchall() - for moduleimpl_id in [x["moduleimpl_id"] for x in res]: + for moduleimpl_id in [x["id"] for x in res]: sco_moduleimpl.do_moduleimpl_inscription_create( {"moduleimpl_id": moduleimpl_id, "etudid": etudid}, formsemestre_id=formsemestre_id, From 18da8c9b93acda587006afc28866c29dd09ffb67 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 27 Jan 2022 11:56:40 +0100 Subject: [PATCH 2/2] Fix: PE missing import --- app/pe/pe_tools.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/pe/pe_tools.py b/app/pe/pe_tools.py index 2c9dd2301..5f58428bb 100644 --- a/app/pe/pe_tools.py +++ b/app/pe/pe_tools.py @@ -35,13 +35,15 @@ Created on Thu Sep 8 09:36:33 2016 @author: barasc """ -from __future__ import print_function import os import datetime import re import unicodedata + +from flask import g + import app.scodoc.sco_utils as scu from app import log from app.scodoc.sco_logos import find_logo @@ -54,7 +56,6 @@ if not PE_DEBUG: # kw is ignored. log always add a newline log(" ".join(a)) - else: pe_print = print # print function @@ -206,7 +207,9 @@ def add_pe_stuff_to_zip(zipfile, ziproot): for name in logos_names: logo = find_logo(logoname=name, dept_id=g.scodoc_dept_id) if logo is not None: - add_local_file_to_zip(zipfile, ziproot, logo.filepath, "avis/logos/" + logo.filename) + add_local_file_to_zip( + zipfile, ziproot, logo.filepath, "avis/logos/" + logo.filename + ) # ----------------------------------------------------------------------------------------