Skip to content

Commit 635e7a4

Browse files
authored
Update lecturer.py
1 parent db25329 commit 635e7a4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rating_api/routes/lecturer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ async def get_lecturers(
135135
if comment.review_status is ReviewStatus.APPROVED
136136
]
137137
if "comments" in info and approved_comments:
138-
lecturer_to_result.comments = approved_comments
138+
lecturer_to_result.comments = sorted(approved_comments, key=lambda comment: comment.create_ts, reverse=True)
139139
if "mark" in info and approved_comments:
140140
lecturer_to_result.mark_freebie = sum([comment.mark_freebie for comment in approved_comments]) / len(
141141
approved_comments

0 commit comments

Comments
 (0)