From 7ab10cef93d7907e2b285a2c061e5a7795e6fece Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 3 Sep 2023 19:23:00 +0200 Subject: [PATCH] Fix 2 typos --- app/api/users.py | 4 ++-- app/scodoc/sco_bulletins_json.py | 2 +- app/scodoc/sco_groups.py | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/api/users.py b/app/api/users.py index 32abccf2..cf017ee6 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 a4ee2ed3..e5e7693d 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 e54100d8..6a7b686d 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é"