mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 10:06:08 -05:00
Merge pull request #1798 from codecombat/master
Fixed a few crashing bugs
This commit is contained in:
commit
3ab8620745
2 changed files with 3 additions and 1 deletions
|
@ -17,6 +17,8 @@ class EarnedAchievementHandler extends Handler
|
||||||
|
|
||||||
get: (req, res) ->
|
get: (req, res) ->
|
||||||
return @getByAchievementIDs(req, res) if req.query.view is 'get-by-achievement-ids'
|
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+''}
|
query = { user: req.user._id+''}
|
||||||
|
|
||||||
projection = {}
|
projection = {}
|
||||||
|
|
|
@ -31,7 +31,7 @@ class LevelSessionHandler extends Handler
|
||||||
|
|
||||||
hasAccessToDocument: (req, document, method=null) ->
|
hasAccessToDocument: (req, document, method=null) ->
|
||||||
return true if req.method is 'GET' and document.get('submitted')
|
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...)
|
super(arguments...)
|
||||||
|
|
||||||
getCodeLanguageCounts: (req, res) ->
|
getCodeLanguageCounts: (req, res) ->
|
||||||
|
|
Loading…
Reference in a new issue