diff --git a/core/server/api/canary/utils/validators/input/invites.js b/core/server/api/canary/utils/validators/input/invites.js index 7bb6eb9053..88d8737562 100644 --- a/core/server/api/canary/utils/validators/input/invites.js +++ b/core/server/api/canary/utils/validators/input/invites.js @@ -1,15 +1,19 @@ const Promise = require('bluebird'); -const i18n = require('../../../../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const models = require('../../../../../models'); +const messages = { + userAlreadyRegistered: 'User is already registered.' +}; + module.exports = { add(apiConfig, frame) { return models.User.findOne({email: frame.data.invites[0].email}, frame.options) .then((user) => { if (user) { return Promise.reject(new errors.ValidationError({ - message: i18n.t('errors.api.users.userAlreadyRegistered') + message: tpl(messages.userAlreadyRegistered) })); } });