mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: ensure the group 'everyone' is never shown when using a different locale
This commit is contained in:
@@ -149,13 +149,10 @@ class Group < ActiveRecord::Base
|
||||
group.save!
|
||||
end
|
||||
|
||||
group.name = I18n.t("groups.default_names.#{name}")
|
||||
|
||||
# don't allow shoddy localization to break this
|
||||
validator = UsernameValidator.new(group.name)
|
||||
unless validator.valid_format?
|
||||
group.name = name
|
||||
end
|
||||
localized_name = I18n.t("groups.default_names.#{name}")
|
||||
validator = UsernameValidator.new(localized_name)
|
||||
group.name = validator.valid_format? ? localized_name : name
|
||||
|
||||
# the everyone group is special, it can include non-users so there is no
|
||||
# way to have the membership in a table
|
||||
|
||||
Reference in New Issue
Block a user