From 96cbcfada2304f03c548f41c684b327d13672aa3 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Fri, 5 Aug 2016 09:21:37 -0700 Subject: [PATCH] :bug:Fix prepaids middleware missing this.logError --- server/middleware/prepaids.coffee | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/middleware/prepaids.coffee b/server/middleware/prepaids.coffee index 80192ddac..11fc9bde2 100644 --- a/server/middleware/prepaids.coffee +++ b/server/middleware/prepaids.coffee @@ -11,10 +11,6 @@ cutoffDate = new Date(2015,11,11) cutoffID = mongoose.Types.ObjectId(Math.floor(cutoffDate/1000).toString(16)+'0000000000000000') module.exports = - logError: (user, msg) -> - console.warn "Prepaid Error: [#{user.get('slug')} (#{user._id})] '#{msg}'" - - post: wrap (req, res) -> validTypes = ['course'] unless req.body.type in validTypes @@ -71,7 +67,7 @@ module.exports = update = { $push: { redeemers : { date: new Date(), userID: user._id } }} result = yield Prepaid.update(query, update) if result.nModified is 0 - @logError(req.user, "POST prepaid redeemer lost race on maxRedeemers") + console.error("Prepaid redeem error: [#{req.user.get('slug')} (#{req.user._id})] 'POST prepaid redeemer lost race on maxRedeemers'") throw new errors.Forbidden('This prepaid is exhausted') update = {