if object doesn't exist user doesn't exist

This commit is contained in:
Barış Soner Uşaklı
2018-03-16 20:49:45 -04:00
parent 2d7d4a3fb4
commit fe18a12ee0

View File

@@ -50,15 +50,12 @@ module.exports = function (User) {
var userData; var userData;
async.waterfall([ async.waterfall([
function (next) { function (next) {
User.exists(uid, next); db.getObject('user:' + uid, next);
},
function (exists, next) {
if (!exists) {
return callback();
}
User.getUserFields(uid, ['username', 'userslug', 'fullname', 'email'], next);
}, },
function (_userData, next) { function (_userData, next) {
if (!_userData) {
return callback();
}
userData = _userData; userData = _userData;
plugins.fireHook('static:user.delete', { uid: uid }, next); plugins.fireHook('static:user.delete', { uid: uid }, next);
}, },