diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 1614035..20f2602 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -49,6 +49,7 @@ def edit def update @course = Course.find_enabled_by params[:id] + initial_hash = @course.to_roster_hash course_form = course_params # Remedy for both new file upload and delete_image are selected course_form.delete(:remove_image) if course_form[:image] && course_form[:image].size.nonzero? @@ -62,7 +63,7 @@ def update raise unless @course.update_attributes course_form.merge(status: term.status) raise t('controllers.courses.manager_creation_failed') unless register_course_managers @course.update_lesson_notes - if SYSTEM_ROSTER_SYNC == :on + if (SYSTEM_ROSTER_SYNC == :on) && !initial_hash.eql?(@course.to_roster_hash) payload = {class: @course.to_roster_hash} response = request_roster_api("/classes/#{@course.sourced_id}", :put, payload) end diff --git a/config/initializers/constants.rb b/config/initializers/constants.rb index 6a6fbea..e4ea3ac 100644 --- a/config/initializers/constants.rb +++ b/config/initializers/constants.rb @@ -15,7 +15,7 @@ # Synchronization mode with IMS OneRoster API: select one from [:on, :suspended, :off] # Check schedule.rb and run "bundle exec whenever -i" when SYSTEM_ROSTER_SYNC changes -SYSTEM_ROSTER_SYNC = :on.freeze +SYSTEM_ROSTER_SYNC = :off.freeze # ===== Versatile constatns ===== # time delay for autocomplete