upgrade script should not delete non-hidden groups

v1.18.x
Julian Lam 11 years ago
parent 1e3b9b7cf6
commit 6f78d29498

@ -492,8 +492,8 @@ Upgrade.upgrade = function(callback) {
function(next) { function(next) {
Groups.list({ showAllGroups: true }, function(err, groups) { Groups.list({ showAllGroups: true }, function(err, groups) {
async.each(groups, function(group, next) { async.each(groups, function(group, next) {
// If deleted, empty, or invalidly named hidden group, delete // If deleted, (hidden & empty), or invalidly named hidden group, delete
if (group.deleted || group.memberCount === 0 || (group.hidden && !isValidHiddenGroup.test(group.name))) { if (group.deleted || (group.hidden && group.memberCount === 0) || (group.hidden && !isValidHiddenGroup.test(group.name))) {
Groups.destroy(group.name, next); Groups.destroy(group.name, next);
} else { } else {
next(); next();

Loading…
Cancel
Save