Fix free invite users modal [SCI-5900]

This commit is contained in:
Martin Artnik 2021-07-13 15:51:05 +02:00
parent d78e4713c8
commit ff0ac9f497
3 changed files with 3 additions and 2 deletions

View file

@ -137,6 +137,7 @@
data.role = modal.attr('data-team-role');
break;
case 'invite':
data.team_ids = [];
break;
case 'invite_with_team_selector':
if (teamSelectorCheckbox.is(':checked')) {

View file

@ -204,7 +204,7 @@ module Users
@emails = params[:emails]&.map(&:downcase)
@teams = Team.where(id: params[:team_ids]).select { |team| can_manage_team_users?(team) }
return render_403 if @teams.none?
return render_403 if params[:team_ids].present? && @teams.none?
@role = params['role']

View file

@ -72,7 +72,7 @@ invite_with_team_selector = type.in?(%w(invite_new_members invite_with_team_sele
<% end %>
</p>
<% if type == 'invite_new_members' %>
<% if type.in? ['invite_new_members', 'invite'] %>
<p><%= t('invite_users.new_members.description') %></p>
<h4 class="heading">
<span><%= t('invite_users.new_members.input_label') %></span>