FIX: Allow uppercase letters in automatic group names

`User.username_exists?` always converts to lowercase during lookup, so this change should be safe.
This commit is contained in:
Gerhard Schlager 2021-07-13 17:08:51 +02:00 committed by Gerhard Schlager
parent 5bff65aa69
commit 6805cc287e
1 changed files with 1 additions and 1 deletions

View File

@ -437,7 +437,7 @@ class Group < ActiveRecord::Base
end end
# don't allow shoddy localization to break this # don't allow shoddy localization to break this
localized_name = User.normalize_username(I18n.t("groups.default_names.#{name}", locale: SiteSetting.default_locale)) localized_name = I18n.t("groups.default_names.#{name}", locale: SiteSetting.default_locale)
validator = UsernameValidator.new(localized_name) validator = UsernameValidator.new(localized_name)
if validator.valid_format? && !User.username_exists?(localized_name) if validator.valid_format? && !User.username_exists?(localized_name)