Removed support for user defined BONUS functions with TWO arguments

This commit is contained in:
Emmanuel Viennet 2021-07-21 15:57:16 +03:00
parent d30c071c5d
commit 35c900b3d7

View File

@ -72,10 +72,6 @@ from app.scodoc import sco_preferences
from app.scodoc import sco_etud
# Support for old user-written "bonus" functions with 2 args:
BONUS_TWO_ARGS = len(inspect.getargspec(scu.CONFIG.compute_bonus)[0]) == 2
def comp_ranks(T):
"""Calcul rangs à partir d'une liste ordonnée de tuples [ (valeur, ..., etudid) ]
(valeur est une note numérique), en tenant compte des ex-aequos
@ -934,12 +930,6 @@ class NotesTable(object):
if len(coefs_bonus_gen) == 1:
coefs_bonus_gen = [1.0] # irrelevant, may be zero
if BONUS_TWO_ARGS:
# backward compat: compute_bonus took only 2 args
bonus = scu.CONFIG.compute_bonus(
notes_bonus_gen, coefs_bonus_gen
)
else:
bonus = scu.CONFIG.compute_bonus(
notes_bonus_gen, coefs_bonus_gen, infos=infos
)