Merge branch 'master' into production

This commit is contained in:
Nick Winter 2016-05-24 13:42:45 -07:00
commit a8acba2039
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ class LevelSessionHandler extends Handler
formatEntity: (req, document) ->
document = super(req, document)
submittedCode = document.submittedCode
submittedCode = document.submittedCode ? {}
unless req.user?.isAdmin() or
req.user?.id is document.creator or
('employer' in (req.user?.get('permissions') ? [])) or

View file

@ -30,7 +30,7 @@ module.exports.sendResponseObject = (res, object) ->
module.exports.formatSessionInformation = (session) ->
heroID = if session.team is 'ogres' then 'hero-placeholder-1' else 'hero-placeholder'
submittedCode = {}
submittedCode[heroID] = plan: LZString.compressToUTF16(session.submittedCode[heroID]?.plan ? '')
submittedCode[heroID] = plan: LZString.compressToUTF16(session.submittedCode?[heroID]?.plan ? '')
_id: session._id
sessionID: session._id