Skip to content

Commit

Permalink
fix: exclude anonymous posts in build_course_stats
Browse files Browse the repository at this point in the history
  • Loading branch information
eemaanamir committed Nov 21, 2023
1 parent f408aa2 commit 2f80c3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def build_course_stats(course_id)
data = Content.collection.aggregate(
[
# Match all content in the course by the specified author
{ "$match" => { :course_id => course_id, :author_id => self.external_id } },
{ "$match" => { :course_id => course_id, :author_id => self.external_id, "anonymous_to_peers" => false, "anonymous" => false } },
# Keep a count of flags for each entry
{
"$addFields" => {
Expand Down

0 comments on commit 2f80c3f

Please sign in to comment.