mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-13 22:49:51 -04:00
Fixed session by converting toObject
This commit is contained in:
parent
9a835ffc0a
commit
128df09ce3
1 changed files with 3 additions and 0 deletions
|
@ -40,7 +40,10 @@ module.exports.createNewTask = (req, res) ->
|
|||
LevelSession.find { "levelID": "project-dota", "submitted": true}, (err, submittedSessions) ->
|
||||
taskPairs = []
|
||||
for session in submittedSessions
|
||||
session = session.toObject()
|
||||
console.log "Attemping to add session of team #{session.team} to taskPairs..."
|
||||
if String(session._id) isnt req.body.session and session.team isnt sessionToScore.team and session.team in ["ogres","humans"]
|
||||
console.log "Adding game to taskPairs!"
|
||||
taskPairs.push [req.body.session,String session._id]
|
||||
async.each taskPairs, sendTaskPairToQueue, (taskPairError) ->
|
||||
return errors.serverError res, "There was an error sending the task pairs to the queue" if taskPairError?
|
||||
|
|
Loading…
Reference in a new issue