diff --git a/lib/tasks/tfxy.rake b/lib/tasks/tfxy.rake index 89e5e4367..db929127c 100644 --- a/lib/tasks/tfxy.rake +++ b/lib/tasks/tfxy.rake @@ -100,7 +100,7 @@ namespace :tfxy do puts "----teach_user-----uid-----#{course_data.cell(r, 5)}------#{teach_user.inspect}---" if !course_group.persisted? && teach_user.present? - course = Course.find_or_initialize_by(school_id: school.id, name: course_data.cell(r, 2)) do |d| + course = Course.find_or_initialize_by(school_id: school.id, name: course_data.cell(r, 2), invite_code: course_data.cell(r, 1)[3..7]) do |d| d.is_public = 0 d.tea_id = teach_user.id d.laboratory_id = Laboratory.find(1)&.id