Skip to content
Snippets Groups Projects
Commit 7669ae11 authored by Martin Mareš's avatar Martin Mareš
Browse files

Course: Updated posts should be also ACKed

parent eec31b26
No related branches found
No related tags found
No related merge requests found
......@@ -174,8 +174,11 @@ def topic_index(sident: str, cident: str, tident: str, student_uid: Optional[int
topic=g.topic)
)
if posts and (seen is None or seen < posts[-1].created):
form.ack_time.data = posts[-1].created
post_times = [p.created for p in posts] + [p.modified for p in posts if p.modified is not None]
if post_times:
last_post_time = max(post_times)
if seen is None or seen < last_post_time:
form.ack_time.data = last_post_time
return render_template(
'topic.html',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment