修改项目邀请用户失败时的提示
This commit is contained in:
parent
ca7c970094
commit
e4e56e01b1
|
@ -99,7 +99,7 @@ class MembersController < ApplicationController
|
|||
@project.members << members
|
||||
# added by nie
|
||||
@project.project_infos << project_info
|
||||
@project.user_grades << user_grades
|
||||
@project.user_grades << user_grades unless user_grades.first.user_id.nil?
|
||||
# end
|
||||
end
|
||||
if members.present? && members.all? { |m| m.valid? }
|
||||
|
@ -108,7 +108,11 @@ class MembersController < ApplicationController
|
|||
end
|
||||
end
|
||||
if params[:flag]
|
||||
flash[:notice] = l(:label_invite_success)
|
||||
unless members.present? && members.all? {|m| m.valid? }
|
||||
flash[:error] = members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ')
|
||||
else
|
||||
flash[:notice] = l(:label_invite_success)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html { redirect_to invite_members_project_url(@project) }
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue