mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Move the unique post key storage code into the Post model
This commit is contained in:
@ -64,7 +64,7 @@ class Validators::PostValidator < ActiveModel::Validator
|
||||
# If the post is empty, default to the validates_presence_of
|
||||
return if post.raw.blank?
|
||||
|
||||
if $redis.exists(post.unique_post_key)
|
||||
if post.matches_recent_post?
|
||||
post.errors.add(:raw, I18n.t(:just_posted_that))
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user