Remove schoolName from school-counts user query

This commit is contained in:
Matt Lott 2016-08-09 06:33:31 -07:00
parent 6a8776c31b
commit 1439016f9b

View file

@ -107,7 +107,7 @@ module.exports =
getStudents: wrap (req, res, next) ->
throw new errors.Unauthorized('You must be an administrator.') unless req.user?.isAdmin()
query = $or: [{role: 'student'}, {$and: [{schoolName: {$exists: true}}, {schoolName: {$ne: ''}}, {anonymous: false}]}]
users = yield User.find(query).select('lastIP schoolName').lean()
users = yield User.find(query).select('lastIP').lean()
for user in users
if ip = user.lastIP
user.geo = geoip.lookup(ip)