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:
Hannah Wolfe 2016-05-17 10:15:23 +01:00
commit 7d7bfc3ece

View File

@ -77,6 +77,9 @@ utils = {
// if we don't have user data and the id is 1, we assume this means the owner
existingUsers[owner.email].importId = userToMap;
userMap[userToMap] = existingUsers[owner.email].realId;
} else if (userToMap === 0) {
// CASE: external context
userMap[userToMap] = '0';
} else {
throw new errors.DataImportError(
i18n.t('errors.data.import.utils.dataLinkedToUnknownUser', {userToMap: userToMap}), 'user.id', userToMap