Fetch the whole user doc

Other attributes are needed to calculate features.
This commit is contained in:
Alberto Fernández Capel
2018-06-27 12:52:47 +01:00
parent 8b8742d60f
commit c19fc6d245
2 changed files with 3 additions and 3 deletions
@@ -5,7 +5,7 @@ Settings = require "settings-sharelatex"
module.exports = ReferalFeatures =
getBonusFeatures: (user_id, callback = (error) ->) ->
UserGetter.getUserOrUserStubById user_id, { _id: 1 }, (error, user) ->
UserGetter.getUserOrUserStubById user_id, null, (error, user) ->
return callback(error) if error
return callback(new Error("user not found #{user_id} for assignBonus")) if !user?
logger.log user_id: user_id, refered_user_count: user.refered_user_count, "assigning bonus"