Merge pull request #3764 from techAPJ/master

FEATURE: add users to group via email
This commit is contained in:
Arpit Jalan 2015-09-15 12:45:11 +05:30
commit 38adb6b6fb
1 changed files with 3 additions and 1 deletions

View File

@ -80,8 +80,10 @@ class Admin::GroupsController < Admin::AdminController
users = User.where(username: params[:usernames].split(","))
elsif params[:user_ids].present?
users = User.find(params[:user_ids].split(","))
elsif params[:user_emails].present?
users = User.where(email: params[:user_emails].split(","))
else
raise Discourse::InvalidParameters.new('user_ids or usernames must be present')
raise Discourse::InvalidParameters.new('user_ids or usernames or user_emails must be present')
end
users.each do |user|