style change

v1.18.x
Baris Usakli 8 years ago
parent 9efa46c65a
commit 081ac6535c

@ -70,10 +70,15 @@ editController.email = function (req, res, next) {
};
function renderRoute(name, req, res, next) {
getUserData(req, next, function (err, userData) {
if (err || !userData) {
return next(err);
async.waterfall([
function (next) {
getUserData(req, next, next);
},
function (userData) {
if (!userData) {
return next();
}
if ((name === 'username' && userData['username:disableEdit']) || (name === 'email' && userData['email:disableEdit'])) {
return next();
}
@ -99,7 +104,8 @@ function renderRoute(name, req, res, next) {
]);
res.render('account/edit/' + name, userData);
});
},
], next);
}
function getUserData(req, next, callback) {

Loading…
Cancel
Save