Skip to content

Commit 8aae42c

Browse files
committed
refactor: refine which automated task comments to filter
1 parent 5e72dae commit 8aae42c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/models/unit.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,10 +2245,11 @@ def tasks_for_moderation(user)
22452245
if mt.escalation?
22462246
[task, Time.zone.at(0)]
22472247
else
2248-
# Ignore automated comments sent from the tutor
2248+
# Skip automated comments that the tutor did not manually send
22492249
tutor_comments = task.comments.select do |c|
22502250
c.user == task.tutor &&
2251-
c.content_type != "assessment" &&
2251+
%w[status discussed_in_class text].include?(c.content_type) &&
2252+
(c.content_type != "status" || c.task_status != "time_exceeded") &&
22522253
!c.comment&.include?("**Automated comment**: Some tests did not pass for this submission.") &&
22532254
!c.comment&.include?("**Automated Comment**: Something went wrong with your submission")
22542255
end

0 commit comments

Comments
 (0)