Adjust 'add-profile-view' in migrations.js in attempt to resolve 1675

This commit is contained in:
RJevnikar 2018-06-06 17:36:20 +00:00
parent d6eff2a074
commit 4787a1186b

View file

@ -211,12 +211,14 @@ Migrations.add('add-checklist-items', () => {
Migrations.add('add-profile-view', () => {
Users.find().forEach((user) => {
// Set default view
Users.direct.update(
{ _id: user._id },
{ $set: { 'profile.boardView': 'board-view-lists' } },
noValidate
);
if (!user.hasOwnProperty('profile.boardView')) {
// Set default view
Users.direct.update(
{ _id: user._id },
{ $set: { 'profile.boardView': 'board-view-lists' } },
noValidate
);
}
});
});