mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
🐛 user was not imported, but the importer tries to correct the reference (#8722)
no issue - this is usually an edge case, but i investigated because i thought that the importer is broken - the importer logic is build like this: - it creates a transaction - this transactions runs through: - beforeImport - doImport - afterImport - afterImport corrects user references and if a user could not be imported, we have to protect that NOTE: we could create two transactions to be more correct, but building this had no priority because of edge cases only having two transactions would solve: you first add the data (error or success), then you correct the data - usually a user can be always imported (!), but there are a few edge cases (e.g. multiple roles attached)
This commit is contained in:
parent
d6aaf2dbc7
commit
5ff7574324
1 changed files with 7 additions and 0 deletions
|
@ -209,6 +209,13 @@ class Base {
|
|||
email: oldUser.email,
|
||||
status: 'all'
|
||||
}, options).then(function (userModel) {
|
||||
// CASE: user could not be imported e.g. multiple roles attached
|
||||
if (!userModel) {
|
||||
userModel = {
|
||||
id: models.User.ownerUser
|
||||
};
|
||||
}
|
||||
|
||||
dataToEdit = {};
|
||||
dataToEdit[key] = userModel.id;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue