From fe18a12ee0c08d6b49996b4817d756f6030a6104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 16 Mar 2018 20:49:45 -0400 Subject: [PATCH] if object doesn't exist user doesn't exist --- src/user/delete.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/user/delete.js b/src/user/delete.js index 0f1ad61047..d5efbdc650 100644 --- a/src/user/delete.js +++ b/src/user/delete.js @@ -50,15 +50,12 @@ module.exports = function (User) { var userData; async.waterfall([ function (next) { - User.exists(uid, next); + db.getObject('user:' + uid, next); }, - function (exists, next) { - if (!exists) { + function (_userData, next) { + if (!_userData) { return callback(); } - User.getUserFields(uid, ['username', 'userslug', 'fullname', 'email'], next); - }, - function (_userData, next) { userData = _userData; plugins.fireHook('static:user.delete', { uid: uid }, next); },