mirror of
https://github.com/discourse/discourse.git
synced 2025-08-18 18:18:09 +08:00
We want to deprecate the enabled/disabled toggle for this setting and rely entirely on the presence of a URL. This change: - Deprecates and hides the enabled/disabled setting. - Updates all code paths and tests that rely on the old setting. - Adds a migration that clears the URL if the enabled/disabled setting is set to false.
15 lines
327 B
Ruby
15 lines
327 B
Ruby
# frozen_string_literal: true
|
|
|
|
class UnicodeUsernameValidator
|
|
def initialize(opts = {})
|
|
@opts = opts
|
|
end
|
|
|
|
def valid_value?(value)
|
|
@valid = SiteSetting.external_system_avatars_url.present? || value == "f"
|
|
end
|
|
|
|
def error_message
|
|
I18n.t("site_settings.errors.unicode_usernames_avatars") if !@valid
|
|
end
|
|
end
|