Browse Source

reverted unintended changes

sou 7 years ago
parent
commit
f75065e1e5
2 changed files with 7 additions and 19 deletions
  1. 1 0
      lib/models/page.js
  2. 6 19
      lib/routes/page.js

+ 1 - 0
lib/models/page.js

@@ -576,6 +576,7 @@ module.exports = function(crowi) {
 
     pathList.push(path);
     const newPath = cutOffLastSlash(path);
+
     return generatePathsOnTree(newPath, pathList);
   };
 

+ 6 - 19
lib/routes/page.js

@@ -281,7 +281,6 @@ module.exports = function(crowi, app) {
         return Revision.findRevisionList(page.path, {})
         .then(function(tree) {
           renderVars.tree = tree;
-          return Promise.resolve();
         })
         .then(function() {
           return Page.checkIfTemplatesExist(originalPath);
@@ -444,25 +443,13 @@ module.exports = function(crowi, app) {
   function renderPage(pageData, req, res) {
     // create page
     if (!pageData) {
-      var userRelatedGroups
-      UserGroupRelation.findAllRelationForUser(req.user)
-        .then((groupRelations) => {
-          userRelatedGroups = groupRelations.map(relation => relation.relatedGroup);
-          return Promise.resolve();
-        }).then(() => {
-          return Page.findTemplate(getPathFromRequest(req));
-        }).then((template) => {
-          debug('not found page user group resolver : ', userRelatedGroups);
-          return res.render('customlayout-selector/not_found', {
-            author: {},
-            page: false,
-            userRelatedGroups: userRelatedGroups,
-            template: template,
-          });
+      Page.findTemplate(getPathFromRequest(req))
+      .then((template) => {
+        return res.render('customlayout-selector/not_found', {
+          author: {},
+          page: false,
+          template: template,
         });
-      return res.render('customlayout-selector/not_found', {
-        author: {},
-        page: false,
       });
     }