* Store config fields as JSON in the db

Fewer parseInts

* Remove unnecessary parseInts

* remove some dupe code add tests

* remove console.log

* remove more parseInts

* WIP: read meta.configs defaults from defaults.json

remove more parseInts

* more work

* add log for failing test

* update admin pwd

* fix tests, dont require posts/cache before configs are initialized

* handle saves

* Test boolean conditions

* remove more parseInts

* Fix boolean values

* remove lots more parseInts

* removed json parsing

* renamed var to number

* categories dont have timestamp
This commit is contained in:
Barış Soner Uşaklı
2018-10-21 16:47:51 -04:00
committed by GitHub
parent 60c58870af
commit 9c022afae1
89 changed files with 440 additions and 309 deletions

View File

@@ -105,7 +105,7 @@ usersController.getUsersSortedByPosts = function (req, res, next) {
};
usersController.getUsersSortedByReputation = function (req, res, next) {
if (parseInt(meta.config['reputation:disabled'], 10) === 1) {
if (meta.config['reputation:disabled']) {
return next();
}
usersController.renderUsersPage('users:reputation', req, res, next);
@@ -169,7 +169,7 @@ usersController.getUsers = function (set, uid, query, callback) {
}
var page = parseInt(query.page, 10) || 1;
var resultsPerPage = parseInt(meta.config.userSearchResultsPerPage, 10) || 50;
var resultsPerPage = meta.config.userSearchResultsPerPage;
var start = Math.max(0, page - 1) * resultsPerPage;
var stop = start + resultsPerPage - 1;
@@ -241,7 +241,7 @@ function render(req, res, data, next) {
data.maximumInvites = meta.config.maximumInvites;
data.inviteOnly = registrationType === 'invite-only' || registrationType === 'admin-invite-only';
data.adminInviteOnly = registrationType === 'admin-invite-only';
data['reputation:disabled'] = parseInt(meta.config['reputation:disabled'], 10) === 1;
data['reputation:disabled'] = meta.config['reputation:disabled'];
async.waterfall([
function (next) {