|
|
@@ -89,7 +89,8 @@ module.exports = function(crowi, app) {
|
|
|
return res.render('me/index', {});
|
|
|
}
|
|
|
|
|
|
- User.findOne({email: email}, (err, existingUserData) => {
|
|
|
+ User.findOne({email: email, _id: {'$ne': userData._id}}, (err, existingUserData) => {
|
|
|
+ // If another user uses the same email, an error will occur.
|
|
|
if (existingUserData) {
|
|
|
debug('Email address was duplicated');
|
|
|
req.form.errors.push('It can not be changed to that mail address');
|