diff --git a/app/api/users.py b/app/api/users.py index 32abccf25..cf017ee6d 100644 --- a/app/api/users.py +++ b/app/api/users.py @@ -218,7 +218,7 @@ def user_password(uid: int): @permission_required(Permission.ScoSuperAdmin) @as_json def user_role_add(uid: int, role_name: str, dept: str = None): - """Add a role to the user""" + """Add a role in the given dept to the user""" user: User = User.query.get_or_404(uid) role: Role = Role.query.filter_by(name=role_name).first_or_404() if dept is not None: # check @@ -247,7 +247,7 @@ def user_role_add(uid: int, role_name: str, dept: str = None): @permission_required(Permission.ScoSuperAdmin) @as_json def user_role_remove(uid: int, role_name: str, dept: str = None): - """Remove the role from the user""" + """Remove the role (in the given dept) from the user""" user: User = User.query.get_or_404(uid) role: Role = Role.query.filter_by(name=role_name).first_or_404() if dept is not None: # check diff --git a/app/scodoc/sco_bulletins_json.py b/app/scodoc/sco_bulletins_json.py index a4ee2ed3e..e5e7693d5 100644 --- a/app/scodoc/sco_bulletins_json.py +++ b/app/scodoc/sco_bulletins_json.py @@ -306,7 +306,7 @@ def formsemestre_bulletinetud_published_dict( appreciations = BulAppreciations.get_appreciations_list(formsemestre.id, etudid) d["appreciation"] = [ { - "comment": quote_xml_attr(appreciation["comment"]), + "comment": quote_xml_attr(appreciation.comment), "date": appreciation.date.isoformat() if appreciation.date else "", } for appreciation in appreciations diff --git a/app/scodoc/sco_groups.py b/app/scodoc/sco_groups.py index e54100d86..6a7b686d8 100644 --- a/app/scodoc/sco_groups.py +++ b/app/scodoc/sco_groups.py @@ -1102,9 +1102,7 @@ def partition_set_attr(partition_id, attr, value): db.session.add(partition) db.session.commit() # invalid bulletin cache - sco_cache.invalidate_formsemestre( - formsemestre_id=partition.formsemestre.id["formsemestre_id"] - ) + sco_cache.invalidate_formsemestre(formsemestre_id=partition.formsemestre.id) return "enregistré"