mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FIX: Users can edit posts when they've reached the newuser_max_replies_per_topic
threshold.
This commit is contained in:
parent
12f89aef95
commit
0c45eba037
2 changed files with 8 additions and 1 deletions
|
@ -42,7 +42,7 @@ class Validators::PostValidator < ActiveModel::Validator
|
|||
end
|
||||
|
||||
def max_posts_validator(post)
|
||||
if post.acting_user.present? && post.acting_user.posted_too_much_in_topic?(post.topic_id)
|
||||
if post.new_record? && post.acting_user.present? && post.acting_user.posted_too_much_in_topic?(post.topic_id)
|
||||
post.errors.add(:base, I18n.t(:too_many_replies))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue