admins: fix import course member

dev_sync_trustie
p31729568 5 years ago
parent 8a37633344
commit 931ba23bcc

@ -423,4 +423,4 @@ RUBY VERSION
ruby 2.3.7p456
BUNDLED WITH
2.0.2
1.17.3

@ -36,7 +36,7 @@ class Admins::ImportCourseMemberService < ApplicationService
member = course.course_members.find_by(user_id: user.id, role: data.role.to_i)
# 如果已是课堂成员且是学生身份and不在指定的分班则移动到该分班
if member.present? && member.role == :STUDENT && course_group && member.course_group_id != course_group&.id
if member.present? && member.role == 'STUDENT' && course_group && member.course_group_id != course_group&.id
member.update!(course_group_id: course_group&.id)
elsif member.blank?
course.course_members.create!(user_id: user.id, role: data.role.to_i, course_group_id: course_group&.id)

Loading…
Cancel
Save