mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-18 19:14:16 +00:00
Fix validation of project-output-file, no build_id for imported v1 projects
This commit is contained in:
parent
f6424ada40
commit
04be842b30
2 changed files with 12 additions and 7 deletions
|
@ -93,11 +93,17 @@ module.exports = ProjectOutputFileAgent = {
|
||||||
_getSourceProject: LinkedFilesHandler.getSourceProject
|
_getSourceProject: LinkedFilesHandler.getSourceProject
|
||||||
|
|
||||||
_validate: (data) ->
|
_validate: (data) ->
|
||||||
return (
|
if data.v1_source_doc_id?
|
||||||
(data.source_project_id? || data.v1_source_doc_id?) &&
|
(
|
||||||
data.source_output_file_path? &&
|
data.v1_source_doc_id? &&
|
||||||
data.build_id?
|
data.source_output_file_path?
|
||||||
)
|
)
|
||||||
|
else
|
||||||
|
(
|
||||||
|
data.source_project_id? &&
|
||||||
|
data.source_output_file_path? &&
|
||||||
|
data.build_id?
|
||||||
|
)
|
||||||
|
|
||||||
_checkAuth: (project_id, data, current_user_id, callback = (err, allowed)->) ->
|
_checkAuth: (project_id, data, current_user_id, callback = (err, allowed)->) ->
|
||||||
callback = _.once(callback)
|
callback = _.once(callback)
|
||||||
|
|
|
@ -428,8 +428,7 @@ describe "LinkedFiles", ->
|
||||||
linkedFileData: {
|
linkedFileData: {
|
||||||
provider: "project_output_file",
|
provider: "project_output_file",
|
||||||
v1_source_doc_id: 9999999, # We won't find this id in the database
|
v1_source_doc_id: 9999999, # We won't find this id in the database
|
||||||
source_output_file_path: "project.pdf",
|
source_output_file_path: "project.pdf"
|
||||||
build_id: '123'
|
|
||||||
},
|
},
|
||||||
_id: "abcdef",
|
_id: "abcdef",
|
||||||
rev: 0,
|
rev: 0,
|
||||||
|
|
Loading…
Reference in a new issue