mirror of
https://github.com/mastodon/mastodon.git
synced 2025-11-27 18:10:58 +00:00
Merge 32c7ae3c0c into 002632c3bb
This commit is contained in:
commit
566c30fbd6
|
|
@ -88,3 +88,27 @@ S3_ALIAS_HOST=files.example.com
|
||||||
# -----------------------
|
# -----------------------
|
||||||
IP_RETENTION_PERIOD=31556952
|
IP_RETENTION_PERIOD=31556952
|
||||||
SESSION_RETENTION_PERIOD=31556952
|
SESSION_RETENTION_PERIOD=31556952
|
||||||
|
|
||||||
|
# Fetch All Replies Behavior
|
||||||
|
# --------------------------
|
||||||
|
|
||||||
|
# Period to wait between fetching replies (in minutes)
|
||||||
|
FETCH_REPLIES_COOLDOWN_MINUTES=15
|
||||||
|
|
||||||
|
# Period to wait after a post is first created before fetching its replies (in minutes)
|
||||||
|
FETCH_REPLIES_INITIAL_WAIT_MINUTES=5
|
||||||
|
|
||||||
|
# Max number of replies to fetch - total, recursively through a whole reply tree
|
||||||
|
FETCH_REPLIES_MAX_GLOBAL=1000
|
||||||
|
|
||||||
|
# Max number of replies to fetch - for a single post
|
||||||
|
FETCH_REPLIES_MAX_SINGLE=500
|
||||||
|
|
||||||
|
# Max number of replies Collection pages to fetch - total
|
||||||
|
FETCH_REPLIES_MAX_PAGES=500
|
||||||
|
|
||||||
|
# Maximum allowed poll options
|
||||||
|
MAX_POLL_OPTIONS=4
|
||||||
|
|
||||||
|
# Maximum allowed poll option characters
|
||||||
|
MAX_POLL_OPTION_CHARS=50
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
# 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 = (ENV['MAX_POLL_OPTION_CHARS'] || 50).to_i
|
||||||
|
|
||||||
def validate(poll)
|
def validate(poll)
|
||||||
poll.errors.add(:options, I18n.t('polls.errors.too_few_options')) unless poll.options.size > 1
|
poll.errors.add(:options, I18n.t('polls.errors.too_few_options')) unless poll.options.size > 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user