mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Add MAX_POLL_OPTIONS
This commit is contained in:
parent
de081c7930
commit
139ca60bb2
2 changed files with 7 additions and 2 deletions
|
|
@ -91,4 +91,9 @@ SESSION_RETENTION_PERIOD=31556952
|
||||||
|
|
||||||
# Max status length limit
|
# Max status length limit
|
||||||
# Maximum allowed character count of one status
|
# Maximum allowed character count of one status
|
||||||
# MAX_STATUS_CHARS=500
|
# MAX_STATUS_CHARS=500
|
||||||
|
|
||||||
|
|
||||||
|
# Max poll option limit
|
||||||
|
# Maximum allowed poll option number
|
||||||
|
# MAX_POLL_OPTIONS=16
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PollOptionsValidator < ActiveModel::Validator
|
class PollOptionsValidator < ActiveModel::Validator
|
||||||
MAX_OPTIONS = 4
|
MAX_OPTIONS = (ENV['MAX_POLL_OPTIONS'] || 4).to_i
|
||||||
MAX_OPTION_CHARS = 50
|
MAX_OPTION_CHARS = 50
|
||||||
|
|
||||||
def validate(poll)
|
def validate(poll)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue