Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
3 changed files with 4 additions and 6 deletions
Showing only changes of commit 9d2148ae69 - Show all commits

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