2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

FIX: Group name was being reverted to non-localized version.

https://meta.discourse.org/t/localized-staff-group-names-changed/65360/16
This commit is contained in:
Guo Xiang Tan 2017-07-14 14:15:33 +09:00
parent e80a1dfa43
commit 9792e03c63
2 changed files with 25 additions and 6 deletions

View file

@ -224,12 +224,9 @@ class Group < ActiveRecord::Base
localized_name = I18n.t("groups.default_names.#{name}").downcase
validator = UsernameValidator.new(localized_name)
group.name =
if !Group.where("LOWER(name) = ?", localized_name).exists? && validator.valid_format?
localized_name
else
name
end
if !Group.where("LOWER(name) = ?", localized_name).exists? && validator.valid_format?
group.name = localized_name
end
# the everyone group is special, it can include non-users so there is no
# way to have the membership in a table