2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-08-18 18:18:09 +08:00
discourse/lib/validators/unicode_username_validator.rb
Ted Johansson 4c7089f817
DEV: Deprecate external_system_avatars_enabled (#33436)
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.
2025-07-04 16:02:04 +08:00

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