mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:04:11 +08:00
FIX: consider staged users mature (no spam checks) after 1 day
This commit is contained in:
parent
2f7a8ed86c
commit
2ff226e509
|
@ -1075,7 +1075,7 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def mature_staged?
|
||||
from_staged? && self.created_at && self.created_at < 1.week.ago
|
||||
from_staged? && self.created_at && self.created_at < 1.day.ago
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
|
@ -967,7 +967,7 @@ describe Post do
|
|||
expect(post.has_host_spam?).to eq(false)
|
||||
end
|
||||
|
||||
it "punishes previously staged users that were created within 1 week" do
|
||||
it "punishes previously staged users that were created within 1 day" do
|
||||
SiteSetting.newuser_spam_host_threshold = 1
|
||||
SiteSetting.newuser_max_links = 3
|
||||
user = Fabricate(:user, staged: true, trust_level: 0)
|
||||
|
@ -977,11 +977,11 @@ describe Post do
|
|||
expect(post.has_host_spam?).to eq(true)
|
||||
end
|
||||
|
||||
it "doesn't punish previously staged users over 1 week old" do
|
||||
it "doesn't punish previously staged users over 1 day old" do
|
||||
SiteSetting.newuser_spam_host_threshold = 1
|
||||
SiteSetting.newuser_max_links = 3
|
||||
user = Fabricate(:user, staged: true, trust_level: 0)
|
||||
user.created_at = 1.week.ago
|
||||
user.created_at = 1.day.ago
|
||||
user.unstage
|
||||
post = Fabricate(:post, raw: raw, user: user)
|
||||
expect(post.has_host_spam?).to eq(false)
|
||||
|
|
Loading…
Reference in New Issue
Block a user