mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-12 07:30:46 +02:00
log out when a doc from the project collection is used
This commit is contained in:
@@ -16,6 +16,7 @@ module.exports = DocManager =
|
||||
if docFromDocCollection?
|
||||
return callback null, docFromDocCollection, mongoPath
|
||||
else if doc?
|
||||
logger.warn project_id:project_id, doc_id:doc_id, "doc just used from project collection, why?"
|
||||
return callback null, doc, mongoPath
|
||||
else
|
||||
return callback new Errors.NotFoundError("No such doc: #{project_id}")
|
||||
|
||||
@@ -11,7 +11,7 @@ describe "DocManager", ->
|
||||
beforeEach ->
|
||||
@DocManager = SandboxedModule.require modulePath, requires:
|
||||
"./MongoManager": @MongoManager = {}
|
||||
"logger-sharelatex": @logger = {log: sinon.stub()}
|
||||
"logger-sharelatex": @logger = {log: sinon.stub(), warn:->}
|
||||
@doc_id = ObjectId().toString()
|
||||
@project_id = ObjectId().toString()
|
||||
@callback = sinon.stub()
|
||||
|
||||
Reference in New Issue
Block a user