Merge remote-tracking branch 'parent/main' into kb_migration
This commit is contained in:
commit
32cfd20257
54 changed files with 1045 additions and 138 deletions
|
@ -3,6 +3,8 @@
|
|||
class Form::AdminSettings
|
||||
include ActiveModel::Model
|
||||
|
||||
include AuthorizedFetchHelper
|
||||
|
||||
KEYS = %i(
|
||||
site_contact_username
|
||||
site_contact_email
|
||||
|
@ -40,6 +42,7 @@ class Form::AdminSettings
|
|||
post_hash_tags_max
|
||||
sensitive_words
|
||||
sensitive_words_for_full
|
||||
authorized_fetch
|
||||
).freeze
|
||||
|
||||
INTEGER_KEYS = %i(
|
||||
|
@ -63,6 +66,7 @@ class Form::AdminSettings
|
|||
captcha_enabled
|
||||
enable_block_emoji_reaction_settings
|
||||
hide_local_users_for_anonymous
|
||||
authorized_fetch
|
||||
).freeze
|
||||
|
||||
UPLOAD_KEYS = %i(
|
||||
|
@ -70,6 +74,10 @@ class Form::AdminSettings
|
|||
mascot
|
||||
).freeze
|
||||
|
||||
OVERRIDEN_SETTINGS = {
|
||||
authorized_fetch: :authorized_fetch_mode?,
|
||||
}.freeze
|
||||
|
||||
STRING_ARRAY_KEYS = %i(
|
||||
ng_words
|
||||
sensitive_words
|
||||
|
@ -97,6 +105,8 @@ class Form::AdminSettings
|
|||
SiteUpload.where(var: key).first_or_initialize(var: key)
|
||||
elsif STRING_ARRAY_KEYS.include?(key)
|
||||
Setting.public_send(key)&.join("\n") || ''
|
||||
elsif OVERRIDEN_SETTINGS.include?(key)
|
||||
public_send(OVERRIDEN_SETTINGS[key])
|
||||
else
|
||||
Setting.public_send(key)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue