|
|
@ -42,6 +42,12 @@ class CreateShixunService < ApplicationService
|
|
|
|
if !Laboratory.current.main_site?
|
|
|
|
if !Laboratory.current.main_site?
|
|
|
|
Laboratory.current.laboratory_shixuns.create!(shixun: shixun, ownership: true)
|
|
|
|
Laboratory.current.laboratory_shixuns.create!(shixun: shixun, ownership: true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# 如果是jupyter,先创建一个目录,为了挂载
|
|
|
|
|
|
|
|
if shixun.is_jupyter?
|
|
|
|
|
|
|
|
folder = edu_setting('shixun_folder')
|
|
|
|
|
|
|
|
path = "#{folder}/#{identifier}"
|
|
|
|
|
|
|
|
FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(dir)
|
|
|
|
|
|
|
|
end
|
|
|
|
return shixun
|
|
|
|
return shixun
|
|
|
|
end
|
|
|
|
end
|
|
|
|
rescue => e
|
|
|
|
rescue => e
|
|
|
|