Shun Miyazawa hace 2 años
padre
commit
c83ef5d2da
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6 2
      apps/app/src/server/models/user.js

+ 6 - 2
apps/app/src/server/models/user.js

@@ -712,9 +712,13 @@ module.exports = function(crowi) {
 
   userSchema.statics.isExistUserByUserPagePath = async function(path) {
     const username = this.getUsernameByPath(path);
-    const user = await this.findOne({ username });
 
-    return user != null;
+    if (username == null) {
+      return false;
+    }
+
+    const isExist = (await this.count({ username })) > 0;
+    return isExist;
   };
 
   userSchema.statics.updateIsInvitationEmailSended = async function(id) {