User.exists change

This commit is contained in:
barisusakli
2015-10-02 16:27:14 -04:00
parent 45ebeb276e
commit b616e69070
6 changed files with 49 additions and 35 deletions

View File

@@ -199,7 +199,7 @@ module.exports = function(User) {
var newUsername = '';
async.forever(function(next) {
newUsername = userData.username + (Math.floor(Math.random() * 255) + 1);
User.exists(newUsername, function(err, exists) {
User.existsBySlug(newUsername, function(err, exists) {
if (err) {
return callback(err);
}