From 6c591a62fda631824e99b314518c5559e0f4bf2f Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 4 Jul 2023 08:23:09 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20=C3=A9dition=20validations=20ant=C3=A9ri?= =?UTF-8?q?eures=20lorsqu'il=20y=20a=20des=20validations=20sans=20semestre?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/jury_but.py | 2 +- app/scodoc/sco_formsemestre_validation.py | 7 +++++-- app/scodoc/sco_semset.py | 2 +- sco_version.py | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/but/jury_but.py b/app/but/jury_but.py index 1ec6eeeaf..02f18dffa 100644 --- a/app/but/jury_but.py +++ b/app/but/jury_but.py @@ -355,7 +355,7 @@ class DecisionsProposeesAnnee(DecisionsProposees): # Reste à attribuer ADM, ADJ, PASD, PAS1NCI, RED, NAR plural = self.nb_validables > 1 explanation += f"""{self.nb_validables} niveau{"x" if plural else ""} validable{ - "s" if plural else ""} sur {self.nb_competences}""" + "s" if plural else ""} de droit sur {self.nb_competences}""" if self.admis: self.codes = [sco_codes.ADM] + self.codes # elif not self.jury_annuel: diff --git a/app/scodoc/sco_formsemestre_validation.py b/app/scodoc/sco_formsemestre_validation.py index 231094475..abe0707f1 100644 --- a/app/scodoc/sco_formsemestre_validation.py +++ b/app/scodoc/sco_formsemestre_validation.py @@ -31,6 +31,7 @@ import time import flask from flask import url_for, flash, g, request +from flask_login import current_user import sqlalchemy as sa from app.models.etudiants import Identite @@ -66,7 +67,7 @@ from app.scodoc.sco_cursus_dut import etud_est_inscrit_ue from app.scodoc import sco_photos from app.scodoc import sco_preferences from app.scodoc import sco_pv_dict - +from app.scodoc.sco_permissions import Permission # ------------------------------------------------------------------------------------ def formsemestre_validation_etud_form( @@ -1288,7 +1289,9 @@ def _get_etud_ue_cap_html(etud: Identite, formsemestre: FormSemestre) -> str: if validation.semestre_id is not None: origine += f" (S{validation.semestre_id})" H.append(f"""
  • {validation.html()}""") - if validation.formsemestre.can_edit_jury(): + if (validation.formsemestre and validation.formsemestre.can_edit_jury()) or ( + current_user and current_user.has_permission(Permission.ScoEtudInscrit) + ): H.append( f"""
    diff --git a/app/scodoc/sco_semset.py b/app/scodoc/sco_semset.py index f3d8c6d3a..251d0468b 100644 --- a/app/scodoc/sco_semset.py +++ b/app/scodoc/sco_semset.py @@ -378,7 +378,7 @@ class SemSet(dict): def html_diagnostic(self): """Affichage de la partie Effectifs et Liste des étudiants - (actif seulement si un portail est configuré) + (actif seulement si un portail est configuré) XXX pourquoi ?? """ if sco_portal_apogee.has_portal(): return self.bilan.html_diagnostic() diff --git a/sco_version.py b/sco_version.py index 832f5c16d..0bd507e8e 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.4.96" +SCOVERSION = "9.4.97" SCONAME = "ScoDoc"