fix(delete account): allow deleting account after they've canceled

subscription, before it terminates
This commit is contained in:
Tyler Renelle 2014-07-07 13:37:16 -06:00
parent e8779f2121
commit 973732421a

View file

@ -258,7 +258,8 @@ api.cron = function(req, res, next) {
// api.reset // Shared.ops
api['delete'] = function(req, res, next) {
if (res.locals.user.purchased.plan.customerId)
var plan = res.locals.user.purchased.plan;
if (plan && plan.customerId && !plan.dateTerminated)
return res.json(400,{err:"You have an active subscription, cancel your plan before deleting your account."});
res.locals.user.remove(function(err){
if (err) return next(err);