0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

🐛 Fixed table constraint error when updating member's email with an already existing email (#12178)

closes #12045

- When member's email is updated to an already existing email of different member it caused table's unique constraint error, which was not handled properly. 
- Added handling for this error similar to one in members `add` method.
This commit is contained in:
Talha 2020-09-10 09:33:57 +05:30 committed by naz
parent 8ea9896622
commit 574f2ca9c1

View file

@ -55,7 +55,9 @@ const doImport = async ({members, labels, importSetLabels, createdBy}) => {
if (error.code === 'ER_DUP_ENTRY') { if (error.code === 'ER_DUP_ENTRY') {
return new errors.ValidationError({ return new errors.ValidationError({
message: i18n.t('errors.models.member.memberAlreadyExists.message'), message: i18n.t('errors.models.member.memberAlreadyExists.message'),
context: i18n.t('errors.models.member.memberAlreadyExists.context'), context: i18n.t('errors.models.member.memberAlreadyExists.context', {
action: 'add'
}),
err: error err: error
}); });
} else { } else {