remove "auto-accept" feature closes #7160
it was misleading to begin with, and downright buggy when combined with open registration test plan: * go to add a user to a course as an admin. no more checkbox Change-Id: Ibb40bae6f5b0a43fe66b2d809d56a256e06e57ba Reviewed-on: https://gerrit.instructure.com/8537 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Jacob Fugal <jacob@instructure.com>
This commit is contained in:
parent
c3cb7481f5
commit
bcc51ad1de
|
@ -813,11 +813,7 @@ class CoursesController < ApplicationController
|
|||
params[:user_list] ||= ""
|
||||
|
||||
respond_to do |format|
|
||||
@enrollment_state = nil
|
||||
if params[:auto_accept] && @context.account.grants_right?(@current_user, session, :manage_admin_users)
|
||||
@enrollment_state = 'active'
|
||||
end
|
||||
if (@enrollments = EnrollmentsFromUserList.process(UserList.new(params[:user_list], @context.root_account, params[:only_search_existing_users] ? false : @context.open_registration_for?(@current_user, session)), @context, :course_section_id => params[:course_section_id], :enrollment_type => params[:enrollment_type], :limit_privileges_to_course_section => params[:limit_privileges_to_course_section] == '1', :enrollment_state => @enrollment_state))
|
||||
if (@enrollments = EnrollmentsFromUserList.process(UserList.new(params[:user_list], @context.root_account, params[:only_search_existing_users] ? false : @context.open_registration_for?(@current_user, session)), @context, :course_section_id => params[:course_section_id], :enrollment_type => params[:enrollment_type], :limit_privileges_to_course_section => params[:limit_privileges_to_course_section] == '1'))
|
||||
format.json do
|
||||
Enrollment.send(:preload_associations, @enrollments, [:course_section, {:user => [:communication_channel, :pseudonym]}])
|
||||
json = @enrollments.map { |e|
|
||||
|
|
|
@ -558,12 +558,6 @@ Hashtags should consist of letters, numbers, dashes and underscores (no spaces).
|
|||
<input type="checkbox" id="limit_privileges_to_course_section" name="limit_privileges_to_course_section" value="1"/>
|
||||
<%= label_tag :limit_privileges_to_course_section, :en => 'these admins can only grade students in their section' %>
|
||||
</span>
|
||||
<% if can_do(@context.account, @current_user, :manage_admin_users) %>
|
||||
<div style="white-space: nowrap;">
|
||||
<input type="checkbox" id="auto_accept_enrollment" name="auto_accept" value="1"/>
|
||||
<%= label_tag :auto_accept_enrollment, :en => "don't send invite, just auto-accept these users" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="teacherless_invite_message" style="<%= hidden unless @context.teacherless? %> font-size: 0.8em;">
|
||||
<%= t('teacherless_invite_details', %{If you invite a teacher and they accept, you will give up administrative privileges for this course.}) %>
|
||||
|
|
|
@ -27,7 +27,6 @@ class EnrollmentsFromUserList
|
|||
|
||||
def initialize(course, opts={})
|
||||
@course = course
|
||||
@enrollment_state = opts[:enrollment_state]
|
||||
@enrollment_type = opts[:enrollment_type] || 'StudentEnrollment'
|
||||
@limit = opts[:limit]
|
||||
@section = (opts[:course_section_id].present? ? @course.course_sections.active.find_by_id(opts[:course_section_id].to_i) : nil) || @course.default_section
|
||||
|
@ -50,7 +49,7 @@ class EnrollmentsFromUserList
|
|||
return unless user
|
||||
return if @enrolled_users.has_key?(user.id)
|
||||
@enrolled_users[user.id] = true
|
||||
@course.enroll_user(user, @enrollment_type, :section => @section, :limit_privileges_to_course_section => @limit_privileges_to_course_section, :enrollment_state => @enrollment_state).tap do |e|
|
||||
@course.enroll_user(user, @enrollment_type, :section => @section, :limit_privileges_to_course_section => @limit_privileges_to_course_section).tap do |e|
|
||||
@enrollments << e if e
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue