mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 15:48:11 -05:00
Fixed a few crashing bugs
This commit is contained in:
parent
d56f594d58
commit
30e08e2c99
2 changed files with 3 additions and 1 deletions
|
@ -17,6 +17,8 @@ class EarnedAchievementHandler extends Handler
|
|||
|
||||
get: (req, res) ->
|
||||
return @getByAchievementIDs(req, res) if req.query.view is 'get-by-achievement-ids'
|
||||
unless req.user
|
||||
return @sendDatabaseError(res, "You need to have a user to view earned achievements")
|
||||
query = { user: req.user._id+''}
|
||||
|
||||
projection = {}
|
||||
|
|
|
@ -31,7 +31,7 @@ class LevelSessionHandler extends Handler
|
|||
|
||||
hasAccessToDocument: (req, document, method=null) ->
|
||||
return true if req.method is 'GET' and document.get('submitted')
|
||||
return true if ('employer' in (req.user.get('permissions') ? [])) and (method ? req.method).toLowerCase() is 'get'
|
||||
return true if ('employer' in (req.user?.get('permissions') ? [])) and (method ? req.method).toLowerCase() is 'get'
|
||||
super(arguments...)
|
||||
|
||||
getCodeLanguageCounts: (req, res) ->
|
||||
|
|
Loading…
Reference in a new issue