Merge pull request #4316 from AntonKhorev/block-reason-max-length

Set max length of block reason
This commit is contained in:
Andy Allan 2024-11-27 17:02:25 +00:00 committed by GitHub
commit c47a40c1db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,7 +28,7 @@
class UserBlock < ApplicationRecord
validate :moderator_permissions
validates :reason, :characters => true
validates :reason, :characters => true, :length => { :maximum => 10000 }
validates :deactivates_at, :comparison => { :greater_than_or_equal_to => :ends_at }, :unless => -> { needs_view }
validates :deactivates_at, :absence => true, :if => -> { needs_view }