Skip to content

Commit

Permalink
Update lecturer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Temmmmmo authored Dec 26, 2024
1 parent 635e7a4 commit 42ed81e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rating_api/routes/lecturer.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async def get_lecturer(id: int, info: list[Literal["comments", "mark"]] = Query(
if comment.review_status is ReviewStatus.APPROVED
]
if "comments" in info and approved_comments:
result.comments = approved_comments
result.comments = sorted(approved_comments, key=lambda comment: comment.create_ts, reverse=True)
if "mark" in info and approved_comments:
result.mark_freebie = sum(comment.mark_freebie for comment in approved_comments) / len(approved_comments)
result.mark_kindness = sum(comment.mark_kindness for comment in approved_comments) / len(approved_comments)
Expand Down

0 comments on commit 42ed81e

Please sign in to comment.