fix(cron): plan check so it passes tests

This commit is contained in:
Tyler Renelle 2014-05-11 15:35:35 -06:00
parent a68c3c3dad
commit c72c8a948f

View file

@ -1270,8 +1270,8 @@ api.wrap = (user, main=true) ->
# If user cancelled subscription, we give them until 30day's end until it terminates
plan = user.purchased.plan
if plan.customerId && plan.dateTerminated && moment(plan.dateTerminated).isBefore(+new Date)
plan = user.purchased?.plan
if plan && plan.customerId && plan.dateTerminated && moment(plan.dateTerminated).isBefore(+new Date)
_.merge user.purchased.plan, {planId:null, customerId:null, paymentMethod:null}
user.markModified 'purchased.plan'