Jury BUT: cosmetic tableau jury (v2)

This commit is contained in:
Emmanuel Viennet 2022-06-27 19:47:41 +02:00
parent aa138133dc
commit e8c8815b24
2 changed files with 17 additions and 7 deletions

View File

@ -270,15 +270,17 @@ def get_group_members(group_id, etat=None):
return r return r
def check_group_name(group_name, partition, raiser=False): def check_group_name(group_name, partition, raiser=False):
"""If groupe name exists in partition : if raiser -> Raise ScoValueError else-> return true""" """If groupe name exists in partition : if raiser -> Raise ScoValueError else-> return true"""
exists = group_name in [g["group_name"] for g in get_partition_groups(partition)] exists = group_name in [g["group_name"] for g in get_partition_groups(partition)]
if exists: if exists:
if raiser: if raiser:
raise ScoValueError("Le nom de groupe existe déjà dans la partition") raise ScoValueError("Le nom de groupe existe déjà dans la partition")
else : else:
return True return True
return False; return False
# obsolete: sco_groups_view.DisplayedGroupsInfos # obsolete: sco_groups_view.DisplayedGroupsInfos
# def get_groups_members(group_ids, etat=None): # def get_groups_members(group_ids, etat=None):
@ -840,14 +842,14 @@ def create_group(partition_id, group_name="", default=False) -> int:
raise ValueError("invalid group name: ()") raise ValueError("invalid group name: ()")
# checkGroupName(group_name) # checkGroupName(group_name)
if check_group_name(group_name, partition): if check_group_name(group_name, partition):
raise ValueError( raise ScoValueError(
"group_name %s already exists in partition" % group_name f"group_name {group_name} already exists in partition"
) # XXX FIX: incorrect error handling (in AJAX) ) # XXX FIX: incorrect error handling (in AJAX)
cnx = ndb.GetDBConnexion() cnx = ndb.GetDBConnexion()
group_id = groupEditor.create( group_id = groupEditor.create(
cnx, {"partition_id": partition_id, "group_name": group_name} cnx, {"partition_id": partition_id, "group_name": group_name}
) )
log("create_group: created group_id=%s" % group_id) log("create_group: created group_id={group_id}")
# #
return group_id return group_id

View File

@ -3788,11 +3788,19 @@ table.table_recap.jury .col_rcue {
} }
table.table_recap.jury tr.even td.col_rcue { table.table_recap.jury tr.even td.col_rcue {
background-color: rgb(243, 243, 243); background-color: #b0d4f8;
} }
table.table_recap.jury tr.odd td.col_rcue { table.table_recap.jury tr.odd td.col_rcue {
background-color: #e6eeed; background-color: #abcdef;
}
table.table_recap.jury tr.odd td.col_rcues_validables {
background-color: #e1d3c5 !important;
}
table.table_recap.jury tr.even td.col_rcues_validables {
background-color: #fcebda !important;
} }
table.table_recap .group { table.table_recap .group {