diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 45c8b4e73..a11ee2289 100755 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -73,7 +73,6 @@ from app.scodoc import sco_formsemestre from app.scodoc import sco_formsemestre_inscriptions from app.scodoc import sco_groups from app.scodoc import sco_moduleimpl -from app.scodoc import sco_permissions_check from app.scodoc import sco_preferences from app.scodoc import sco_users from app.scodoc.gen_tables import GenTable @@ -340,6 +339,7 @@ def formsemestre_status_menubar(formsemestre: FormSemestre) -> str: }, ] + can_change_groups = formsemestre.can_change_groups() menu_groupes = [ { "title": "Listes, photos, feuilles...", @@ -352,27 +352,20 @@ def formsemestre_status_menubar(formsemestre: FormSemestre) -> str: "title": "Modifier groupes et partitions", "endpoint": "scolar.partition_editor", "args": {"formsemestre_id": formsemestre_id}, - "enabled": sco_groups.sco_permissions_check.can_change_groups( - formsemestre_id - ), + "enabled": can_change_groups, "helpmsg": "Editeur de partitions", }, { "title": "Ancienne page édition partitions", "endpoint": "scolar.edit_partition_form", "args": {"formsemestre_id": formsemestre_id}, - "enabled": sco_groups.sco_permissions_check.can_change_groups( - formsemestre_id - ), + "enabled": can_change_groups, }, ] # 1 item / partition: partitions = sco_groups.get_partitions_list(formsemestre_id, with_default=False) submenu = [] - enabled = ( - sco_groups.sco_permissions_check.can_change_groups(formsemestre_id) - and partitions - ) + enabled = can_change_groups and partitions for partition in partitions: submenu.append( { @@ -922,7 +915,7 @@ def _make_listes_sem(formsemestre: FormSemestre, with_absences=True): H.append("") if partition_is_empty: H.append('
Aucun groupe peuplé dans cette partition') - if sco_groups.sco_permissions_check.can_change_groups(formsemestre.id): + if formsemestre.can_change_groups(): H.append( f""" (créer)""" ) H.append("
") - if sco_groups.sco_permissions_check.can_change_groups(formsemestre.id): + if formsemestre.can_change_groups(): H.append( f"""