mirror of
https://github.com/discourse/discourse.git
synced 2025-06-17 16:42:30 +08:00
FIX: unable to save groups with mixed case names
This commit is contained in:
@ -600,7 +600,7 @@ class Group < ActiveRecord::Base
|
|||||||
self.name.downcase!
|
self.name.downcase!
|
||||||
|
|
||||||
UsernameValidator.perform_validation(self, 'name') || begin
|
UsernameValidator.perform_validation(self, 'name') || begin
|
||||||
if will_save_change_to_name?
|
if will_save_change_to_name? && name_was&.downcase != self.name
|
||||||
existing = Group.exec_sql(
|
existing = Group.exec_sql(
|
||||||
User::USERNAME_EXISTS_SQL, username: self.name
|
User::USERNAME_EXISTS_SQL, username: self.name
|
||||||
).values.present?
|
).values.present?
|
||||||
|
Reference in New Issue
Block a user