فهرست منبع

Fix installe detection

Sotaro KARASAWA 11 سال پیش
والد
کامیت
1cef6790b0
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      lib/middlewares.js

+ 3 - 2
lib/middlewares.js

@@ -106,7 +106,7 @@ exports.applicationNotInstalled = function() {
   return function(req, res, next) {
     var config = req.config;
 
-    if (Object.keys(config.crowi).length !== 0) {
+    if (Object.keys(config.crowi).length !== 1) {
       return res.render('500', { error: 'Application already installed.' });
     }
 
@@ -117,8 +117,9 @@ exports.applicationNotInstalled = function() {
 exports.applicationInstalled = function() {
   return function(req, res, next) {
     var config = req.config;
+    console.log(config);
 
-    if (Object.keys(config.crowi).length === 0) {
+    if (Object.keys(config.crowi).length === 1) { // app:url is set by process
       return res.redirect('/installer');
     }