From 597b83e6a45a81a595693f49da6fdb46ed5eb8d1 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 21 Jun 2021 11:22:55 +0200 Subject: [PATCH] suite --- app/auth/models.py | 2 +- app/scodoc/debug.py | 4 ++-- app/scodoc/pe_jurype.py | 15 ++++++------ app/scodoc/sco_abs_views.py | 12 ++++------ app/scodoc/sco_etape_apogee.py | 2 +- app/scodoc/sco_evaluations.py | 9 +++---- app/scodoc/sco_find_etud.py | 4 ++-- app/scodoc/sco_formsemestre.py | 3 +++ app/scodoc/sco_formsemestre_edit.py | 7 +++--- app/scodoc/sco_formsemestre_inscriptions.py | 2 +- app/scodoc/sco_formsemestre_status.py | 4 ---- app/scodoc/sco_groups.py | 18 +++++++++----- app/scodoc/sco_groups_view.py | 4 ++-- app/scodoc/sco_import_etuds.py | 4 ++-- app/scodoc/sco_page_etud.py | 10 ++++---- app/scodoc/sco_preferences.py | 13 +++++++---- app/views/__init__.py | 2 +- app/views/absences.py | 18 ++++++-------- app/views/scolar.py | 26 ++++++++++++--------- 19 files changed, 83 insertions(+), 76 deletions(-) diff --git a/app/auth/models.py b/app/auth/models.py index 85b9243b..a1db43e6 100644 --- a/app/auth/models.py +++ b/app/auth/models.py @@ -133,7 +133,7 @@ class User(UserMixin, db.Model): Args: perm: integer, one of the value defined in Permission class. - context: + dept: dept id (eg 'RT') """ if dept is False: dept = g.scodoc_dept diff --git a/app/scodoc/debug.py b/app/scodoc/debug.py index 2c529885..4685dcca 100644 --- a/app/scodoc/debug.py +++ b/app/scodoc/debug.py @@ -19,7 +19,7 @@ authuser = app.acl_users.getUserById('admin') authuser = authuser.__of__(app.acl_users) Exemple: -sems = context.Notes.formsemestre_list() +sems = sco_formsemestre.do_formsemestre_list.formsemestre_list(context) formsemestre_id = sems[0]['formsemestre_id'] # Affiche tous les semestres: @@ -27,7 +27,7 @@ for sem in sems: print sem['formsemestre_id'], sem['titre_num'] # Recupere la table de notes: -nt = sco_core.get_notes_cache(context).get_NotesTable(context.Notes, formsemestre_id) +nt = sco_core.get_notes_cache(context).get_NotesTable(context, formsemestre_id) """ diff --git a/app/scodoc/pe_jurype.py b/app/scodoc/pe_jurype.py index f0270cea..4c9fd4be 100644 --- a/app/scodoc/pe_jurype.py +++ b/app/scodoc/pe_jurype.py @@ -59,6 +59,7 @@ import app.scodoc.sco_utils as scu from app.scodoc import sco_codes_parcours # sco_codes_parcours.NEXT -> sem suivant from app.scodoc import sco_core from app.scodoc import sco_etud +from app.scodoc import sco_formsemestre from app.scodoc import pe_tagtable from app.scodoc import pe_tools from app.scodoc import pe_semestretag @@ -332,7 +333,7 @@ class JuryPE: nt = self.get_cache_notes_d_un_semestre( self.context, sem["formsemestre_id"] ) - # sco_core.get_notes_cache(context).get_NotesTable(context.Notes, sem['formsemestre_id']) + # sco_core.get_notes_cache(context).get_NotesTable(context, sem['formsemestre_id']) etudiantsDuSemestre = ( nt.get_etudids() ) # nt.identdict.keys() # identification des etudiants du semestre @@ -467,7 +468,7 @@ class JuryPE: reponse = False etud = self.get_cache_etudInfo_d_un_etudiant(self.context, etudid) - (_, parcours) = sco_report.get_codeparcoursetud(self.context.Notes, etud) + (_, parcours) = sco_report.get_codeparcoursetud(self.context, etud) if ( len(set(sco_codes_parcours.CODES_SEM_REO.keys()) & set(parcours.values())) > 0 @@ -499,7 +500,7 @@ class JuryPE: lastdate = max(sesdates) # date de fin de l'inscription la plus récente # if PETable.AFFICHAGE_DEBUG_PE == True : pe_tools.pe_print(" derniere inscription = ", lastDateSem) - semestresDeScoDoc = self.context.Notes.formsemestre_list() + semestresDeScoDoc = sco_formsemestre.formsemestre_list(self.context) semestresSuperieurs = [ sem for sem in semestresDeScoDoc if sem["semestre_id"] > sonDernierSidValide ] # Semestre de rang plus élevé que son dernier sem valide @@ -531,7 +532,7 @@ class JuryPE: etud = self.get_cache_etudInfo_d_un_etudiant(self.context, etudid) (code, parcours) = sco_report.get_codeparcoursetud( - self.context.Notes, etud + self.context, etud ) # description = '1234:A', parcours = {1:ADM, 2:NAR, ...} sonDernierSemestreValide = max( [ @@ -1141,7 +1142,7 @@ class JuryPE: ): # inutile en realité ! """Charge la table des notes d'un formsemestre""" return sco_core.get_notes_cache(context).get_NotesTable( - context.Notes, formsemestre_id + context, formsemestre_id ) # ------------------------------------------------------------------------------------------------------------------ @@ -1246,8 +1247,8 @@ def get_cosemestres_diplomants(context, semBase, avec_meme_formation=False): > dont la formation est la même (optionnel) > ne prenant en compte que les etudiants sans redoublement """ - tousLesSems = ( - context.Notes.formsemestre_list() + tousLesSems = sco_formsemestre.formsemestre_list( + context ) # tous les semestres memorises dans scodoc diplome = get_annee_diplome_semestre(semBase) diff --git a/app/scodoc/sco_abs_views.py b/app/scodoc/sco_abs_views.py index 654c9049..baa84096 100644 --- a/app/scodoc/sco_abs_views.py +++ b/app/scodoc/sco_abs_views.py @@ -125,9 +125,7 @@ def doSignaleAbsence( if moduleimpl_id and moduleimpl_id != "NULL": mod = sco_moduleimpl.do_moduleimpl_list(context, moduleimpl_id=moduleimpl_id)[0] formsemestre_id = mod["formsemestre_id"] - nt = sco_core.get_notes_cache(context).get_NotesTable( - context.Notes, formsemestre_id - ) + nt = sco_core.get_notes_cache(context).get_NotesTable(context, formsemestre_id) ues = nt.get_ues(etudid=etudid) for ue in ues: modimpls = nt.get_modimpls(ue_id=ue["ue_id"]) @@ -186,9 +184,7 @@ def SignaleAbsenceEtud(context, REQUEST=None): # etudid implied require_module = sco_preferences.get_preference( context, "abs_require_module", formsemestre_id ) - nt = sco_core.get_notes_cache(context).get_NotesTable( - context.Notes, formsemestre_id - ) + nt = sco_core.get_notes_cache(context).get_NotesTable(context, formsemestre_id) ues = nt.get_ues(etudid=etudid) if require_module: menu_module = """ @@ -968,7 +964,7 @@ def _TablesAbsEtud( ex = [] for ev in a["evals"]: mod = sco_moduleimpl.do_moduleimpl_withmodule_list( - context.Notes, moduleimpl_id=ev["moduleimpl_id"] + context, moduleimpl_id=ev["moduleimpl_id"] )[0] if format == "html": ex.append( @@ -985,7 +981,7 @@ def _TablesAbsEtud( ex = [] for ev in a.get("absent", []): mod = sco_moduleimpl.do_moduleimpl_withmodule_list( - context.Notes, moduleimpl_id=ev["moduleimpl_id"] + context, moduleimpl_id=ev["moduleimpl_id"] )[0] if format == "html": ex.append( diff --git a/app/scodoc/sco_etape_apogee.py b/app/scodoc/sco_etape_apogee.py index 89b189ac..5ffc5495 100644 --- a/app/scodoc/sco_etape_apogee.py +++ b/app/scodoc/sco_etape_apogee.py @@ -389,7 +389,7 @@ apo_csv_store(context, csv_data, annee_scolaire, sem_id) groups_infos = sco_groups_view.DisplayedGroupsInfos(context, [sco_groups.get_default_group(context, formsemestre_id)], formsemestre_id=formsemestre_id, REQUEST=REQUEST) -nt = sco_core.get_notes_cache(context).get_NotesTable(context.Notes, formsemestre_id) +nt = sco_core.get_notes_cache(context).get_NotesTable(context, formsemestre_id) # s = SemSet(context, 'NSS29902') diff --git a/app/scodoc/sco_evaluations.py b/app/scodoc/sco_evaluations.py index b275e9f6..76de15f2 100644 --- a/app/scodoc/sco_evaluations.py +++ b/app/scodoc/sco_evaluations.py @@ -27,10 +27,11 @@ """Evaluations """ +import datetime +import operator +import pprint import time import urllib -import operator -import datetime from app.scodoc.notes_log import log, logCallStack import app.scodoc.sco_utils as scu @@ -339,7 +340,7 @@ def do_evaluation_edit(context, REQUEST, args): _check_evaluation_args(context, args) cnx = ndb.GetDBConnexion() - context._evaluationEditor.edit(cnx, args) + _evaluationEditor.edit(cnx, args) # inval cache pour ce semestre M = sco_moduleimpl.do_moduleimpl_list(context, moduleimpl_id=moduleimpl_id)[0] sco_core.inval_cache( @@ -369,7 +370,7 @@ def do_evaluation_delete(context, REQUEST, evaluation_id): cnx = ndb.GetDBConnexion() - context._evaluationEditor.delete(cnx, evaluation_id) + _evaluationEditor.delete(cnx, evaluation_id) # inval cache pour ce semestre M = sco_moduleimpl.do_moduleimpl_list(context, moduleimpl_id=moduleimpl_id)[0] sco_core.inval_cache(context, formsemestre_id=M["formsemestre_id"]) # > eval delete diff --git a/app/scodoc/sco_find_etud.py b/app/scodoc/sco_find_etud.py index b5f6bf1c..2ac608a3 100644 --- a/app/scodoc/sco_find_etud.py +++ b/app/scodoc/sco_find_etud.py @@ -274,8 +274,8 @@ def search_etud_in_accessible_depts(context, expnom=None, code_nip=None, REQUEST """ result = [] accessible_depts = [] - dept_list = sco_mgr.get_dept_ids() - for dept in dept_list: + depts = sco_mgr.get_dept_ids() + for dept in depts: # log('%s searching %s' % (str(REQUEST.AUTHENTICATED_USER),dept)) if REQUEST.AUTHENTICATED_USER.has_permission(Permission.ScoView, dept=dept): if expnom or code_nip: diff --git a/app/scodoc/sco_formsemestre.py b/app/scodoc/sco_formsemestre.py index c2a89b73..92379bcc 100644 --- a/app/scodoc/sco_formsemestre.py +++ b/app/scodoc/sco_formsemestre.py @@ -221,6 +221,9 @@ def etapes_apo_str(etapes): def do_formsemestre_create(context, args, REQUEST, silent=False): "create a formsemestre" + from app.scodoc import sco_groups + from app.scodoc import sco_news + cnx = ndb.GetDBConnexion() formsemestre_id = _formsemestreEditor.create(cnx, args) if args["etapes"]: diff --git a/app/scodoc/sco_formsemestre_edit.py b/app/scodoc/sco_formsemestre_edit.py index 3cec2e1e..a199c6fb 100644 --- a/app/scodoc/sco_formsemestre_edit.py +++ b/app/scodoc/sco_formsemestre_edit.py @@ -1043,7 +1043,9 @@ def do_formsemestre_clone( args = e.copy() del args["jour"] # erase date args["moduleimpl_id"] = mid - _ = sco_evaluations.do_evaluation_create(context, REQUEST=REQUEST, **args) + _ = sco_evaluations.do_evaluation_create( + context, REQUEST=REQUEST, **args + ) # 3- copy uecoefs objs = sco_formsemestre.formsemestre_uecoef_list( @@ -1345,7 +1347,7 @@ def do_formsemestre_delete(context, formsemestre_id, REQUEST): sem = sco_formsemestre.get_formsemestre(context, formsemestre_id) # --- Destruction des modules de ce semestre - mods = sco_moduleimpl.do_moduleimpl_list(formsemestre_id=formsemestre_id) + mods = sco_moduleimpl.do_moduleimpl_list(context, formsemestre_id=formsemestre_id) for mod in mods: # evaluations evals = sco_evaluations.do_evaluation_list( @@ -1535,7 +1537,6 @@ def formsemestre_edit_uecoefs(context, formsemestre_id, err_ue_id=None, REQUEST= """Changement manuel des coefficients des UE capitalisées.""" from app.scodoc import notes_table - context = context.Notes # si appele d'en haut, eg par exception ScoValueError ok, err = sco_permissions_check.check_access_diretud( context, formsemestre_id, REQUEST ) diff --git a/app/scodoc/sco_formsemestre_inscriptions.py b/app/scodoc/sco_formsemestre_inscriptions.py index 19d36d40..1b007aac 100644 --- a/app/scodoc/sco_formsemestre_inscriptions.py +++ b/app/scodoc/sco_formsemestre_inscriptions.py @@ -346,7 +346,7 @@ def formsemestre_inscription_with_modules( ] F = html_sco_header.sco_footer(context, REQUEST) # Check 1: déjà inscrit ici ? - ins = context.Notes.do_formsemestre_inscription_list({"etudid": etudid}) + ins = do_formsemestre_inscription_list(context, {"etudid": etudid}) already = False for i in ins: if i["formsemestre_id"] == formsemestre_id: diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 047c6786..86ab3557 100644 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -527,10 +527,6 @@ def formsemestre_page_title(context, REQUEST): """Element HTML decrivant un semestre (barre de menu et infos) Cherche dans REQUEST si un semestre est défini (formsemestre_id ou moduleimpl ou evaluation ou group) """ - try: - context = context.Notes - except: - pass formsemestre_id = retreive_formsemestre_from_request(context, REQUEST) # if not formsemestre_id: diff --git a/app/scodoc/sco_groups.py b/app/scodoc/sco_groups.py index ea7be9bb..15a81067 100644 --- a/app/scodoc/sco_groups.py +++ b/app/scodoc/sco_groups.py @@ -442,7 +442,7 @@ def XMLgetGroupsInPartition(context, partition_id, REQUEST=None): # was XMLgetG sem = sco_formsemestre.get_formsemestre(context, formsemestre_id) groups = get_partition_groups(context, partition) nt = sco_core.get_notes_cache(context).get_NotesTable( - context.Notes, formsemestre_id + context, formsemestre_id ) # > inscrdict etuds_set = set(nt.inscrdict) # XML response: @@ -595,7 +595,9 @@ def change_etud_group_in_partition( ) cnx.commit() # 4- invalidate cache - context.Notes._inval_cache(formsemestre_id=formsemestre_id) # > change etud group + sco_core.inval_cache( + context, formsemestre_id=formsemestre_id + ) # > change etud group def setGroups( @@ -948,8 +950,8 @@ def partition_set_attr(context, partition_id, attr, value, REQUEST=None): partition[attr] = value partitionEditor.edit(cnx, partition) # invalid bulletin cache - context.Notes._inval_cache( - pdfonly=True, formsemestre_id=partition["formsemestre_id"] + sco_core.inval_cache( + context, pdfonly=True, formsemestre_id=partition["formsemestre_id"] ) return "enregistré" @@ -1187,6 +1189,8 @@ def groups_auto_repartition(context, partition_id=None, REQUEST=None): """Reparti les etudiants dans des groupes dans une partition, en respectant le niveau et la mixité. """ + from app.scodoc import sco_formsemestre + partition = get_partition(context, partition_id) formsemestre_id = partition["formsemestre_id"] # renvoie sur page édition groupes @@ -1260,7 +1264,7 @@ def groups_auto_repartition(context, partition_id=None, REQUEST=None): ) # nt = sco_core.get_notes_cache(context).get_NotesTable( - context.Notes, formsemestre_id + context, formsemestre_id ) # > identdict identdict = nt.identdict # build: { civilite : liste etudids trie par niveau croissant } @@ -1268,7 +1272,7 @@ def groups_auto_repartition(context, partition_id=None, REQUEST=None): listes = {} for civilite in civilites: listes[civilite] = [ - (get_prev_moy(context.Notes, x["etudid"], formsemestre_id), x["etudid"]) + (get_prev_moy(context, x["etudid"], formsemestre_id), x["etudid"]) for x in identdict.values() if x["civilite"] == civilite ] @@ -1472,6 +1476,8 @@ def form_group_choice( """Partie de formulaire pour le choix d'un ou plusieurs groupes. Variable : group_ids """ + from app.scodoc import sco_formsemestre + sem = sco_formsemestre.get_formsemestre(context, formsemestre_id) if display_sem_title: sem_title = "%s: " % sem["titremois"] diff --git a/app/scodoc/sco_groups_view.py b/app/scodoc/sco_groups_view.py index b0c26bf3..b710d843 100644 --- a/app/scodoc/sco_groups_view.py +++ b/app/scodoc/sco_groups_view.py @@ -791,10 +791,10 @@ def groups_table( sco_etud.etud_add_lycee_infos(etud) # et ajoute le parcours Se = sco_parcours_dut.SituationEtudParcours( - context.Notes, etud, groups_infos.formsemestre_id + context, etud, groups_infos.formsemestre_id ) m["parcours"] = Se.get_parcours_descr() - m["codeparcours"], _ = sco_report.get_codeparcoursetud(context.Notes, etud) + m["codeparcours"], _ = sco_report.get_codeparcoursetud(context, etud) def dicttakestr(d, keys): r = [] diff --git a/app/scodoc/sco_import_etuds.py b/app/scodoc/sco_import_etuds.py index 1c7675df..ae1a5223 100644 --- a/app/scodoc/sco_import_etuds.py +++ b/app/scodoc/sco_import_etuds.py @@ -232,7 +232,7 @@ def students_import_excel( "import students from Excel file" diag = scolars_import_excel_file( csvfile, - context.Notes, + context, REQUEST, formsemestre_id=formsemestre_id, check_homonyms=check_homonyms, @@ -490,7 +490,7 @@ def scolars_import_excel_file( cnx.commit() # Invalide les caches des semestres dans lesquels on a inscrit des etudiants: - context.Notes._inval_cache(formsemestre_id_list=formsemestre_to_invalidate) + sco_core.inval_cache(context, formsemestre_id_list=formsemestre_to_invalidate) return diag diff --git a/app/scodoc/sco_page_etud.py b/app/scodoc/sco_page_etud.py index 7ae06b65..07e11e7f 100644 --- a/app/scodoc/sco_page_etud.py +++ b/app/scodoc/sco_page_etud.py @@ -211,7 +211,7 @@ def ficheEtud(context, etudid=None, REQUEST=None): for sem in info["sems"]: if sem["ins"]["etat"] != "I": descr, _ = etud_descr_situation_semestre( - context.Notes, + context, etudid, sem["formsemestre_id"], info["ne"], @@ -239,10 +239,10 @@ def ficheEtud(context, etudid=None, REQUEST=None): if info["sems"]: Se = sco_parcours_dut.SituationEtudParcours( - context.Notes, etud, info["last_formsemestre_id"] + context, etud, info["last_formsemestre_id"] ) info["liste_inscriptions"] = formsemestre_recap_parcours_table( - context.Notes, + context, Se, etudid, with_links=False, @@ -535,7 +535,7 @@ def etud_info_html(context, etudid, with_photo="1", REQUEST=None, debug=False): Used for popups information windows. """ try: - context = context.Notes + context = context except: pass # log('etud_info_html: %s' % REQUEST.QUERY_STRING) @@ -551,7 +551,7 @@ def etud_info_html(context, etudid, with_photo="1", REQUEST=None, debug=False): ) # experimental: may be too slow to be here etud["codeparcours"], etud["decisions_jury"] = sco_report.get_codeparcoursetud( - context.Notes, etud, prefix="S", separator=", " + context, etud, prefix="S", separator=", " ) bac = sco_bac.Baccalaureat(etud["bac"], etud["specialite"]) diff --git a/app/scodoc/sco_preferences.py b/app/scodoc/sco_preferences.py index 444ab600..b526b834 100644 --- a/app/scodoc/sco_preferences.py +++ b/app/scodoc/sco_preferences.py @@ -112,11 +112,12 @@ get_base_preferences(context, formsemestre_id) """ from flask import g -import app.scodoc.sco_utils as scu -import app.scodoc.notesdb as ndb +from app.scodoc import sco_core from app.scodoc.notes_log import log from app.scodoc.sco_exceptions import ScoValueError, ScoException from app.scodoc.TrivialFormulator import TrivialFormulator +import app.scodoc.notesdb as ndb +import app.scodoc.sco_utils as scu _SCO_BASE_PREFERENCES = {} # { URL: BasePreferences instance } @@ -1919,7 +1920,7 @@ class BasePreferences(object): # les preferences peuvent affecter les PDF cachés et les notes calculées: if modif: - self.context.Notes._inval_cache(pdfonly=False) # > modif preferences + sco_core.inval_cache(self.context, pdfonly=False) # > modif preferences finally: scu.GSL.release() @@ -1947,7 +1948,7 @@ class BasePreferences(object): if pdb: log("deleting pref sem=%s %s" % (formsemestre_id, name)) self._editor.delete(cnx, pdb[0]["pref_id"]) - self.context.Notes._inval_cache(pdfonly=False) # > modif preferences + sco_core.inval_cache(self.context, pdfonly=False) # > modif preferences finally: scu.GSL.release() @@ -2091,7 +2092,9 @@ class SemPreferences(object): ) # a bug ! sem = sco_formsemestre.get_formsemestre(self.context, self.formsemestre_id) H = [ - self.context.Notes.html_sem_header(REQUEST, "Préférences du semestre", sem), + html_sco_header.html_sem_header( + self.context, REQUEST, "Préférences du semestre", sem + ), """

Les paramètres définis ici ne s'appliqueront qu'à ce semestre.

Attention: cliquez sur "Enregistrer les modifications" en bas de page pour appliquer vos changements !

diff --git a/app/views/__init__.py b/app/views/__init__.py index abffe92d..08815db7 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -10,4 +10,4 @@ essais_bp = Blueprint("essais", __name__) from app.views import notes, scolar, absences, essais -scolar.context.Notes = notes.context +scolar.context.Notes = notes.context # XXX transitoire #sco8 diff --git a/app/views/absences.py b/app/views/absences.py index 871ed4e0..9fb8f387 100644 --- a/app/views/absences.py +++ b/app/views/absences.py @@ -240,7 +240,7 @@ def SignaleAbsenceGrHebdo( [ x["etudid"] for x in sco_moduleimpl.do_moduleimpl_inscription_list( - context.Notes, moduleimpl_id=moduleimpl_id + context, moduleimpl_id=moduleimpl_id ) ] ) @@ -250,9 +250,7 @@ def SignaleAbsenceGrHebdo( else: # Si aucun etudiant n'est inscrit au module choisi... moduleimpl_id = None - nt = sco_core.get_notes_cache(context).get_NotesTable( - context.Notes, formsemestre_id - ) + nt = sco_core.get_notes_cache(context).get_NotesTable(context, formsemestre_id) sem = sco_formsemestre.do_formsemestre_list( context, {"formsemestre_id": formsemestre_id} )[0] @@ -406,7 +404,7 @@ def SignaleAbsenceGrSemestre( [ x["etudid"] for x in sco_moduleimpl.do_moduleimpl_inscription_list( - context.Notes, moduleimpl_id=moduleimpl_id + context, moduleimpl_id=moduleimpl_id ) ] ) @@ -425,9 +423,7 @@ def SignaleAbsenceGrSemestre( base_url = base_url_noweeks + "&nbweeks=%s" % nbweeks # sans le moduleimpl_id if etuds: - nt = sco_core.get_notes_cache(context).get_NotesTable( - context.Notes, formsemestre_id - ) + nt = sco_core.get_notes_cache(context).get_NotesTable(context, formsemestre_id) sem = sco_formsemestre.do_formsemestre_list( context, {"formsemestre_id": formsemestre_id} )[0] @@ -643,7 +639,7 @@ def _gen_form_saisie_groupe( cap = [] if etud["cursem"]: nt = sco_core.get_notes_cache(context).get_NotesTable( - context.Notes, etud["cursem"]["formsemestre_id"] + context, etud["cursem"]["formsemestre_id"] ) # > get_ues, get_etud_ue_status for ue in nt.get_ues(): status = nt.get_etud_ue_status(etudid, ue["ue_id"]) @@ -850,8 +846,8 @@ def EtatAbsencesGr( init_qtip=True, javascripts=["js/etud_info.js"], ), - html_title=context.Notes.html_sem_header( - REQUEST, "%s" % title, sem, with_page_header=False + html_title=html_sco_header.html_sem_header( + context, REQUEST, "%s" % title, sem, with_page_header=False ) + "

Période du %s au %s (nombre de demi-journées)
" % (debut, fin), base_url="%s&formsemestre_id=%s&debut=%s&fin=%s" diff --git a/app/views/scolar.py b/app/views/scolar.py index 5230ce02..0d9e7c49 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -89,6 +89,7 @@ from app.scodoc import sco_import_etuds from app.scodoc import sco_abs from app.scodoc import sco_archives_etud from app.scodoc import sco_codes_parcours +from app.scodoc import sco_core from app.scodoc import sco_debouche from app.scodoc import sco_dept from app.scodoc import sco_dump_db @@ -197,7 +198,7 @@ def edit_preferences(context, REQUEST): def formsemestre_edit_preferences(context, formsemestre_id, REQUEST): """Edit preferences for a semestre""" authuser = REQUEST.AUTHENTICATED_USER - sem = sco_formsemestre.get_formsemestre(context.Notes, formsemestre_id) + sem = sco_formsemestre.get_formsemestre(context, formsemestre_id) ok = ( authuser.has_permission(Permission.ScoImplement) or ((str(authuser) in sem["responsables"]) and sem["resp_can_edit"]) @@ -1411,8 +1412,8 @@ def _etudident_create_or_edit_form(context, REQUEST, edit): # Inval semesters with this student: to_inval = [s["formsemestre_id"] for s in etud["sems"]] if to_inval: - context.Notes._inval_cache( - formsemestre_id_list=to_inval + sco_core.inval_cache( + context, formsemestre_id_list=to_inval ) # > etudident_create_or_edit # return REQUEST.RESPONSE.redirect("ficheEtud?etudid=" + etudid) @@ -1476,7 +1477,7 @@ def etudident_delete(context, etudid, dialog_confirmed=False, REQUEST=None): # Inval semestres où il était inscrit: to_inval = [s["formsemestre_id"] for s in etud["sems"]] if to_inval: - context.Notes._inval_cache(formsemestre_id_list=to_inval) # > + sco_core.inval_cache(context, formsemestre_id_list=to_inval) # > return REQUEST.RESPONSE.redirect( scu.ScoURL() + r"?head_message=Etudiant%20supprimé" ) @@ -1499,8 +1500,11 @@ def check_group_apogee( cnx = ndb.GetDBConnexion() H = [ - context.Notes.html_sem_header( - REQUEST, "Etudiants du %s" % (group["group_name"] or "semestre"), sem + html_sco_header.html_sem_header( + context, + REQUEST, + "Etudiants du %s" % (group["group_name"] or "semestre"), + sem, ), '', "", @@ -1628,7 +1632,7 @@ def check_group_apogee( def form_students_import_excel(context, REQUEST, formsemestre_id=None): "formulaire import xls" if formsemestre_id: - sem = sco_formsemestre.get_formsemestre(context.Notes, formsemestre_id) + sem = sco_formsemestre.get_formsemestre(context, formsemestre_id) dest_url = ( scu.ScoURL() + "/formsemestre_status?formsemestre_id=%s" % formsemestre_id ) @@ -1793,7 +1797,7 @@ def import_generate_admission_sample(context, REQUEST, formsemestre_id): only_tables=["identite", "admissions", "adresse"], exclude_cols=["nationalite", "foto", "photo_filename"], group_ids=[group["group_id"]], - context=context.Notes, + context=context, REQUEST=REQUEST, ) return sco_excel.sendExcelFile(REQUEST, data, "AdmissionEtudiants.xls") @@ -1915,7 +1919,7 @@ def _students_import_admission( "import donnees admission from Excel file (v2016)" diag = sco_import_etuds.scolars_import_admission( csvfile, - context.Notes, + context, REQUEST, formsemestre_id=formsemestre_id, type_admission=type_admission, @@ -1950,10 +1954,10 @@ def formsemestre_import_etud_admission( unknowns, changed_mails, ) = sco_synchro_etuds.formsemestre_import_etud_admission( - context.Notes, formsemestre_id, import_identite=True, import_email=import_email + context, formsemestre_id, import_identite=True, import_email=import_email ) H = [ - context.Notes.html_sem_header(REQUEST, "Reimport données admission"), + html_sco_header.html_sem_header(context, REQUEST, "Reimport données admission"), "

Opération effectuée

", ] if no_nip:
NomNom usuelPrénomMailNIP (ScoDoc)Apogée