Add additional conditions to internal/reports page (#4800) [deploy]

* Add additional conditions to internal/reports page

* Add higher number for randomness
This commit is contained in:
Ben Halpern 2019-11-12 13:19:08 -05:00 committed by GitHub
parent 9d347e5e81
commit af04fd7959
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -10,9 +10,9 @@ class Internal::FeedbackMessagesController < Internal::ApplicationController
order("feedback_messages.created_at DESC").
page(params[:page] || 1).per(5)
@email_messages = EmailMessage.find_for_reports(@feedback_messages)
@new_articles = Article.limit(150).order("created_at DESC").where("score > ? AND score < ?", -10, 8)
@possible_spam_users = User.where("github_created_at > ? OR twitter_created_at > ?", 48.hours.ago, 48.hours.ago).
where("created_at > ?", 36.hours.ago).
@new_articles = Article.published.includes(:user).limit(120).order("created_at DESC").where("score > ? AND score < ?", -10, 8)
@possible_spam_users = User.where("github_created_at > ? OR twitter_created_at > ? OR length(name) > ?", 50.hours.ago, 50.hours.ago, 30).
where("created_at > ?", 48.hours.ago).
order("created_at DESC").
where.not("username LIKE ?", "%spam_%").limit(150)
@vomits = get_vomits

View file

@ -25,11 +25,11 @@ module Moderator
private
def reassign_and_bust_username
new_name = "spam_#{rand(10_000)}"
new_username = "spam_#{rand(10_000)}"
new_name = "spam_#{rand(1_000_000)}"
new_username = "spam_#{rand(1_000_000)}"
if User.find_by(name: new_name) || User.find_by(username: new_username)
new_name = "spam_#{rand(10_000)}"
new_username = "spam_#{rand(10_000)}"
new_name = "spam_#{rand(1_000_000)}"
new_username = "spam_#{rand(1_000_000)}"
end
user.update_columns(name: new_name, username: new_username, old_username: user.username, profile_updated_at: Time.current)
CacheBuster.new.bust("/#{user.old_username}")