Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions forum/backends/mysql/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,12 @@ def create_comment(cls, data: dict[str, Any]) -> str:
)
new_comment.sort_key = new_comment.get_sort_key()
new_comment.save()

# Update thread's last activity timestamp to mark it as having new activity
if comment_thread:
comment_thread.last_activity_at = timezone.now()
comment_thread.save(update_fields=["last_activity_at"])

if data.get("parent_id"):
cls.update_child_count_in_parent_comment(data["parent_id"], 1)
cls.update_stats_for_course(data["author_id"], data["course_id"], replies=1)
Expand Down