forked from e621ng/e621ng
[Users] Add a size limit to the body of feedback
This commit is contained in:
parent
056ce3e7aa
commit
7c7c2f1870
@ -4,6 +4,7 @@ class UserFeedback < ApplicationRecord
|
||||
belongs_to_creator
|
||||
validates :body, :category, presence: true
|
||||
validates :category, inclusion: { in: %w[positive negative neutral] }
|
||||
validates :body, length: { minimum: 1, maximum: Danbooru.config.user_feedback_max_size }
|
||||
validate :creator_is_moderator, on: :create
|
||||
validate :user_is_not_creator
|
||||
after_save :create_dmail
|
||||
|
@ -6,6 +6,6 @@
|
||||
<% unless user_feedback.new_record? %>
|
||||
<%= f.input :send_update_dmail, label: "Send update DMail", as: :boolean %>
|
||||
<% end %>
|
||||
<%= f.input :body, as: :dtext %>
|
||||
<%= f.input :body, as: :dtext, limit: Danbooru.config.user_feedback_max_size %>
|
||||
<%= f.button :submit, "Submit" %>
|
||||
<% end %>
|
||||
|
@ -329,6 +329,10 @@ module Danbooru
|
||||
250_000
|
||||
end
|
||||
|
||||
def user_feedback_max_size
|
||||
20_000
|
||||
end
|
||||
|
||||
def discord_site
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user