Flag requirements are not looking at disposition


(Sam Saffron) #1

Continuing the discussion from Feature Request: Banned Users Prevent Promotion:

 def num_flagged_posts
    PostAction.with_deleted.where(post_id: flagged_post_ids).where.not(user_id: @user.id).pluck(:post_id).uniq.count
  end

So, for example, if I go an flag 5 posts of a user I hate, regardless of flag disposition (mod can disagree), this user will not make it to leader for the next 100 days

This should be fixed.

cc @zogstrip @neil


(Jeff Atwood) #2

If so that is a bug, I explicitly said 5 flags on 5 different posts by 5 different users.

But we planned to make more changes around better flag disposition normalization.


(Neil Lalonde) #3

There are more methods you should have pasted here:

  def flagged_post_ids
    # (TODO? and moderators explicitly agreed with the flags)
    @user.posts.with_deleted.where('created_at > ? AND (spam_count > 0 OR inappropriate_count > 0)', TIME_PERIOD.days.ago).pluck(:id)
  end
  def num_flagged_by_users
    PostAction.with_deleted.where(post_id: flagged_post_ids).where.not(user_id: @user.id).pluck(:user_id).uniq.count
  end

Notice that flagged_post_ids is used by both of the other methods, and flagged_post_ids is scoped to the last 100 days.

Also we have a big TODO there because we needed to do the better flag disposition normalization in order to add the “moderators agree” requirement. We can complete that todo now? I think @zogstrip added everything we need, correct?


(Régis Hanol) #4

Yes you can now that we have agreed_at :wink:


(Jeff Atwood) #5

This is now implemented and working.


(Jeff Atwood) #6