got rid of extra call to user.getSettings

This commit is contained in:
barisusakli
2015-10-23 14:07:09 -04:00
parent 0e057a3d92
commit 751a6c6839
2 changed files with 4 additions and 9 deletions

View File

@@ -67,13 +67,6 @@ module.exports = function(app, middleware) {
templateValues.configJSON = JSON.stringify(res.locals.config);
async.parallel({
settings: function(next) {
if (req.uid) {
user.getSettings(req.uid, next);
} else {
next();
}
},
isAdmin: function(next) {
user.isAdministrator(req.uid, next);
},
@@ -107,8 +100,8 @@ module.exports = function(app, middleware) {
results.user.uid = parseInt(results.user.uid, 10);
results.user['email:confirmed'] = parseInt(results.user['email:confirmed'], 10) === 1;
if (results.settings && results.settings.bootswatchSkin && results.settings.bootswatchSkin !== 'default') {
templateValues.bootswatchCSS = '//maxcdn.bootstrapcdn.com/bootswatch/latest/' + results.settings.bootswatchSkin + '/bootstrap.min.css';
if (res.locals.config.bootswatchSkin !== 'default') {
templateValues.bootswatchCSS = '//maxcdn.bootstrapcdn.com/bootswatch/latest/' + res.locals.config.bootswatchSkin + '/bootstrap.min.css';
}
templateValues.browserTitle = controllers.helpers.buildTitle(data.title);