Merge branch 'ja_email_tokens' of github.com:sharelatex/web-sharelatex into ja_email_tokens

This commit is contained in:
Shane Kilkelly 2016-03-08 14:38:31 +00:00
commit 8f2d2cfeff

View file

@ -43,23 +43,6 @@ ProjectSchema.statics.getProject = (project_or_id, fields, callback)->
return callback(new Errors.NotFoundError(e.message))
this.findById project_or_id, fields, callback
ProjectSchema.statics.findPopulatedById = (project_id, callback)->
logger.log project_id:project_id, "findPopulatedById"
this.find(_id: project_id )
.populate('collaberator_refs')
.populate('readOnly_refs')
.populate('owner_ref')
.exec (err, projects)->
if err?
logger.err err:err, project_id:project_id, "something went wrong looking for project findPopulatedById"
callback(err)
else if !projects? || projects.length == 0
logger.err project_id:project_id, "something went wrong looking for project findPopulatedById, no project could be found"
callback "not found"
else
logger.log project_id:project_id, "finished findPopulatedById"
callback(null, projects[0])
sanitizeTypeOfElement = (elementType)->
lastChar = elementType.slice -1
if lastChar != "s"