mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: sending messages to groups with non-lowercase names
Fixes a regression in
e8fb9d4066
which caused a bug where you couldn't send a message to a group that
contained an Uppercase letter. Added a test case for this.
Bug report: https://meta.discourse.org/t/-/152999
This commit is contained in:
@@ -246,10 +246,10 @@ class TopicCreator
|
||||
|
||||
def add_groups(topic, groups)
|
||||
return unless groups
|
||||
names = groups.split(',').flatten
|
||||
names = groups.split(',').flatten.map(&:downcase)
|
||||
len = 0
|
||||
|
||||
Group.where(name: names).each do |group|
|
||||
Group.where('lower(name) in (?)', names).each do |group|
|
||||
check_can_send_permission!(topic, group)
|
||||
topic.topic_allowed_groups.build(group_id: group.id)
|
||||
len += 1
|
||||
|
||||
Reference in New Issue
Block a user