diff --git a/app/scodoc/TrivialFormulator.py b/app/scodoc/TrivialFormulator.py
index 52270915..0920ab0e 100644
--- a/app/scodoc/TrivialFormulator.py
+++ b/app/scodoc/TrivialFormulator.py
@@ -543,11 +543,8 @@ class TF(object):
disabled_items = descr.get("disabled_items", {})
if vertical:
lem.append("
")
- for i in range(len(labels)):
+ for i in range(len(labels)): # pylint: disable=consider-using-enumerate
if input_type == "checkbox":
- # from app.scodoc.sco_utils import log # debug only
- # log('checkbox: values[%s] = "%s"' % (field,repr(values[field]) ))
- # log("descr['allowed_values'][%s] = '%s'" % (i, repr(descr['allowed_values'][i])))
if (
values[field]
and descr["allowed_values"][i] in values[field]
@@ -563,7 +560,7 @@ class TF(object):
else:
try:
v = int(values[field])
- except:
+ except (ValueError, KeyError):
v = False
if v:
checked = 'checked="checked"'
diff --git a/app/scodoc/sco_preferences.py b/app/scodoc/sco_preferences.py
index 4e5a8a2f..f6315583 100644
--- a/app/scodoc/sco_preferences.py
+++ b/app/scodoc/sco_preferences.py
@@ -2113,28 +2113,22 @@ class BasePreferences(object):
if "explanation" in descr:
del descr["explanation"]
if formsemestre_id:
- descr["explanation"] = (
- """ou utiliser paramètre global"""
- % pref_name
- )
- # if descr.get('only_global',False):
- # # pas modifiable, donne juste la valeur courante
- # descr['readonly'] = True
- # descr['explanation'] = '(valeur globale, non modifiable)'
- # elif
+ descr[
+ "explanation"
+ ] = """ou utiliser paramètre global"""
if formsemestre_id and self.is_global(formsemestre_id, pref_name):
# valeur actuelle globale (ou vient d'etre supprimee localement):
# montre la valeur et menus pour la rendre locale
descr["readonly"] = True
- menu_global = (
- """