mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
🐛Analytics sub page sponsor recipient null check
This commit is contained in:
parent
63e38c82b2
commit
87b9d74dc1
1 changed files with 1 additions and 1 deletions
|
@ -408,7 +408,7 @@ UserHandler = class UserHandler extends Handler
|
|||
|
||||
getSubSponsors: (req, res) ->
|
||||
return @sendForbiddenError(res) unless req.user?.isAdmin()
|
||||
Payment.find {$where: 'this.purchaser.valueOf() != this.recipient.valueOf()'}, (err, payments) =>
|
||||
Payment.find {$where: 'this.purchaser && this.recipient && this.purchaser.valueOf() != this.recipient.valueOf()'}, (err, payments) =>
|
||||
return @sendDatabaseError(res, err) if err
|
||||
sponsorIDs = (payment.get('purchaser') for payment in payments)
|
||||
User.find {$and: [{_id: {$in: sponsorIDs}}, {"stripe.sponsorSubscriptionID": {$exists: true}}]}, (err, users) =>
|
||||
|
|
Loading…
Reference in a new issue