Fix 2 typos

This commit is contained in:
Emmanuel Viennet 2023-09-03 19:23:00 +02:00
parent 3bfe717e42
commit 7ab10cef93
3 changed files with 4 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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é"