From caf88c5909a9c6a0ea9c069d6cdf94a01052bbaa Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 15 Oct 2022 10:27:00 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20affichage=20coef.=20=C3=A9valuations=20m?= =?UTF-8?q?odules=20bonus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/auth/routes.py | 4 ++-- app/scodoc/sco_groups.py | 8 ++++---- app/scodoc/sco_moduleimpl_status.py | 17 ++++++++++------- sco_version.py | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/app/auth/routes.py b/app/auth/routes.py index b1a0c41dd..46d144d63 100644 --- a/app/auth/routes.py +++ b/app/auth/routes.py @@ -63,7 +63,7 @@ def create_user(): user.set_password(form.password.data) db.session.add(user) db.session.commit() - flash("User {} created".format(user.user_name)) + flash(f"Utilisateur {user.user_name} créé") return redirect(url_for("scodoc.index")) return render_template( "auth/register.html", title="Création utilisateur", form=form @@ -104,7 +104,7 @@ def reset_password_request(): @bp.route("/reset_password/", methods=["GET", "POST"]) def reset_password(token): - "Reset passord après demande par mail" + "Reset password après demande par mail" if current_user.is_authenticated: return redirect(url_for("scodoc.index")) user: User = User.verify_reset_password_token(token) diff --git a/app/scodoc/sco_groups.py b/app/scodoc/sco_groups.py index 4da76d313..c741e5972 100644 --- a/app/scodoc/sco_groups.py +++ b/app/scodoc/sco_groups.py @@ -229,13 +229,13 @@ def get_default_group(formsemestre_id, fix_if_missing=False): # No default group (problem during sem creation) # Try to create it log( - "*** Warning: get_default_group(formsemestre_id=%s): default group missing, recreating it" - % formsemestre_id + f"""*** Warning: get_default_group(formsemestre_id={formsemestre_id + }): default group missing, recreating it""" ) try: partition_id = get_default_partition(formsemestre_id)["partition_id"] except ScoException: - log("creating default partition for %s" % formsemestre_id) + log(f"creating default partition for {formsemestre_id}") partition_id = partition_create( formsemestre_id, default=True, redirect=False ) @@ -243,7 +243,7 @@ def get_default_group(formsemestre_id, fix_if_missing=False): return group.id # debug check if len(r) != 1: - raise ScoException("invalid group structure for %s" % formsemestre_id) + raise ScoException(f"invalid group structure for {formsemestre_id}") group_id = r[0]["group_id"] return group_id diff --git a/app/scodoc/sco_moduleimpl_status.py b/app/scodoc/sco_moduleimpl_status.py index facd03a78..5720e6ea9 100644 --- a/app/scodoc/sco_moduleimpl_status.py +++ b/app/scodoc/sco_moduleimpl_status.py @@ -41,6 +41,7 @@ from app.models import ModuleImpl from app.models.evaluations import Evaluation from app.models.ues import UniteEns import app.scodoc.sco_utils as scu +from app.scodoc.sco_codes_parcours import UE_SPORT from app.scodoc.sco_exceptions import ScoInvalidIdType from app.scodoc.sco_cursus_dut import formsemestre_has_decisions from app.scodoc.sco_permissions import Permission @@ -49,7 +50,6 @@ from app.scodoc import html_sco_header from app.scodoc import htmlutils from app.scodoc import sco_abs from app.scodoc import sco_compute_moy -from app.scodoc import sco_cache from app.scodoc import sco_edit_module from app.scodoc import sco_evaluations from app.scodoc import sco_evaluation_db @@ -533,12 +533,15 @@ def _ligne_evaluation( if evaluation.set_default_poids(): db.session.commit() coef *= sum(evaluation.get_ue_poids_dict().values()) - # Avertissement si coefs x poids nuls - if coef < scu.NOTES_PRECISION: - H.append("""coef. nul !""") - elif is_apc: - # visualisation des poids - H.append(_evaluation_poids_html(evaluation)) + + if modimpl.module.ue.type != UE_SPORT: + # Avertissement si coefs x poids nuls + if coef < scu.NOTES_PRECISION: + H.append("""coef. nul !""") + elif is_apc: + # visualisation des poids + H.append(_evaluation_poids_html(evaluation)) + if evaluation.jour: H.append( f"""Le {evaluation.jour.strftime("%d/%m/%Y")} {evaluation.descr_heure()}""" diff --git a/sco_version.py b/sco_version.py index 7f84a6ea8..59711dafe 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.3.56" +SCOVERSION = "9.3.57" SCONAME = "ScoDoc"