mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 07:07:43 +08:00
FIX: error looking at users in admin when tl3_promotion_min_duration is set to a very high value
This commit is contained in:
@ -947,6 +947,8 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def on_tl3_grace_period?
|
||||
return true if SiteSetting.tl3_promotion_min_duration.to_i.days.ago.year < 2013
|
||||
|
||||
UserHistory.for(self, :auto_trust_level_change)
|
||||
.where('created_at >= ?', SiteSetting.tl3_promotion_min_duration.to_i.days.ago)
|
||||
.where(previous_value: TrustLevel[2].to_s)
|
||||
|
Reference in New Issue
Block a user