forked from ScoDoc/ScoDoc
Fix: affichage coef. évaluations modules bonus
This commit is contained in:
parent
4da21bf4d3
commit
caf88c5909
@ -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/<token>", 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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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())
|
||||
|
||||
if modimpl.module.ue.type != UE_SPORT:
|
||||
# Avertissement si coefs x poids nuls
|
||||
if coef < scu.NOTES_PRECISION:
|
||||
H.append("""<span class="eval_warning_coef">coef. nul !</span>""")
|
||||
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()}"""
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- mode: python -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
SCOVERSION = "9.3.56"
|
||||
SCOVERSION = "9.3.57"
|
||||
|
||||
SCONAME = "ScoDoc"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user