mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 13:07:17 -04:00
Merge pull request #3140 from marc1006/2310
Fix Registration broken "Templates board id is required"
This commit is contained in:
commit
446a81ddd0
3 changed files with 24 additions and 1 deletions
|
@ -1075,6 +1075,7 @@ if (Meteor.isServer) {
|
|||
incrementBoards(_.difference(newIds, oldIds), +1);
|
||||
});
|
||||
|
||||
// Override getUserId so that we can TODO get the current userId
|
||||
const fakeUserId = new Meteor.EnvironmentVariable();
|
||||
const getUserId = CollectionHooks.getUserId;
|
||||
CollectionHooks.getUserId = () => {
|
||||
|
@ -1108,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'),
|
||||
|
@ -1135,6 +1140,7 @@ if (Meteor.isServer) {
|
|||
Users.update(fakeUserId.get(), {
|
||||
$set: { 'profile.cardTemplatesSwimlaneId': swimlaneId },
|
||||
});
|
||||
future1.return();
|
||||
},
|
||||
);
|
||||
|
||||
|
@ -1152,6 +1158,7 @@ if (Meteor.isServer) {
|
|||
Users.update(fakeUserId.get(), {
|
||||
$set: { 'profile.listTemplatesSwimlaneId': swimlaneId },
|
||||
});
|
||||
future2.return();
|
||||
},
|
||||
);
|
||||
|
||||
|
@ -1169,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).
|
||||
|
|
8
package-lock.json
generated
8
package-lock.json
generated
|
@ -1744,6 +1744,14 @@
|
|||
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
|
||||
"dev": true
|
||||
},
|
||||
"fibers": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fibers/-/fibers-5.0.0.tgz",
|
||||
"integrity": "sha512-UpGv/YAZp7mhKHxDvC1tColrroGRX90sSvh8RMZV9leo+e5+EkRVgCEZPlmXeo3BUNQTZxUaVdLskq1Q2FyCPg==",
|
||||
"requires": {
|
||||
"detect-libc": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"figures": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
"bunyan": "^1.8.12",
|
||||
"csv-stringify": "^5.5.0",
|
||||
"es6-promise": "^4.2.4",
|
||||
"fibers": "^5.0.0",
|
||||
"flatted": "^2.0.1",
|
||||
"gridfs-stream": "^0.5.3",
|
||||
"jszip": "^3.4.0",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue