mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 16:14:25 +03:00
Merge pull request #6842 from kirrg001/fix/import-when-userid-is-0
fix: support successful import/export with user id 0
This commit is contained in:
commit
7d7bfc3ece
@ -77,6 +77,9 @@ utils = {
|
|||||||
// if we don't have user data and the id is 1, we assume this means the owner
|
// if we don't have user data and the id is 1, we assume this means the owner
|
||||||
existingUsers[owner.email].importId = userToMap;
|
existingUsers[owner.email].importId = userToMap;
|
||||||
userMap[userToMap] = existingUsers[owner.email].realId;
|
userMap[userToMap] = existingUsers[owner.email].realId;
|
||||||
|
} else if (userToMap === 0) {
|
||||||
|
// CASE: external context
|
||||||
|
userMap[userToMap] = '0';
|
||||||
} else {
|
} else {
|
||||||
throw new errors.DataImportError(
|
throw new errors.DataImportError(
|
||||||
i18n.t('errors.data.import.utils.dataLinkedToUnknownUser', {userToMap: userToMap}), 'user.id', userToMap
|
i18n.t('errors.data.import.utils.dataLinkedToUnknownUser', {userToMap: userToMap}), 'user.id', userToMap
|
||||||
|
Loading…
Reference in New Issue
Block a user