Merge pull request #957 from sharelatex/hb-force-v1-image-templates

Force gallery items to use legacy OL v1 texlive image
This commit is contained in:
Brian Gough 2018-09-25 09:27:54 +01:00 committed by GitHub
commit a524f99fbf
2 changed files with 21 additions and 10 deletions

View file

@ -45,6 +45,7 @@ module.exports = TemplatesController =
docId: req.body.docId
templateId: req.body.templateId
templateVersionId: req.body.templateVersionId
image: 'wl_texlive:2018.1'
},
req,
res
@ -63,6 +64,7 @@ module.exports = TemplatesController =
logger.err err:err, zipReq:zipReq, "problem building project from zip"
return res.sendStatus 500
setCompiler project._id, options.compiler, ->
setImage project._id, options.image, ->
fs.unlink dumpPath, ->
delete req.session.templateData
conditions = {_id:project._id}
@ -78,3 +80,9 @@ setCompiler = (project_id, compiler, callback)->
ProjectOptionsHandler.setCompiler project_id, compiler, callback
else
callback()
setImage = (project_id, imageName, callback)->
if imageName?
ProjectOptionsHandler.setImageName project_id, imageName, callback
else
callback()

View file

@ -22,7 +22,10 @@ describe 'TemplatesController', ->
}
@ProjectUploadManager = {createProjectFromZipArchive : sinon.stub().callsArgWith(3, null, {_id:project_id})}
@dumpFolder = "dump/path"
@ProjectOptionsHandler = {setCompiler:sinon.stub().callsArgWith(2)}
@ProjectOptionsHandler = {
setCompiler:sinon.stub().callsArgWith(2)
setImageName:sinon.stub().callsArgWith(2)
}
@uuid = "1234"
@ProjectDetailsHandler =
getProjectDescription:sinon.stub()