diff options
author | Marc Hartmayer <hello@hartmayer.com> | 2020-05-29 23:42:19 +0200 |
---|---|---|
committer | Marc Hartmayer <hello@hartmayer.com> | 2020-05-29 23:42:19 +0200 |
commit | 5fd167c18288c716d6cf9325ed5d9cdc9f2b8567 (patch) | |
tree | 77e592205827504acb7e0c753e24eff6ab2bbaca /models | |
parent | 7cd57ee023bdda7029d5fa7dd384c4219d76ce6a (diff) | |
download | wekan-5fd167c18288c716d6cf9325ed5d9cdc9f2b8567.tar.gz wekan-5fd167c18288c716d6cf9325ed5d9cdc9f2b8567.tar.bz2 wekan-5fd167c18288c716d6cf9325ed5d9cdc9f2b8567.zip |
REALLY, REALLY UGLY HACK
Diffstat (limited to 'models')
-rw-r--r-- | models/users.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/models/users.js b/models/users.js index dee112cd..976e5068 100644 --- a/models/users.js +++ b/models/users.js @@ -1109,6 +1109,10 @@ if (Meteor.isServer) { }); */ + const Future = require('fibers/future'); + let future1 = new Future(); + let future2 = new Future(); + let future3 = new Future(); Boards.insert( { title: TAPi18n.__('templates'), @@ -1136,6 +1140,7 @@ if (Meteor.isServer) { Users.update(fakeUserId.get(), { $set: { 'profile.cardTemplatesSwimlaneId': swimlaneId }, }); + future1.return(); }, ); @@ -1153,6 +1158,7 @@ if (Meteor.isServer) { Users.update(fakeUserId.get(), { $set: { 'profile.listTemplatesSwimlaneId': swimlaneId }, }); + future2.return(); }, ); @@ -1170,15 +1176,22 @@ if (Meteor.isServer) { Users.update(fakeUserId.get(), { $set: { 'profile.boardTemplatesSwimlaneId': swimlaneId }, }); + future3.return(); }, ); }, ); + // HACK + future1.wait(); + future2.wait(); + future3.wait(); }); }); } - Users.after.insert((userId, doc) => { + Users.after.insert((userId, doc) => { + // HACK + doc = Users.findOne({_id: doc._id}); if (doc.createdThroughApi) { // The admin user should be able to create a user despite disabling registration because // it is two different things (registration and creation). |