]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3145 During migration, access to Sonar is not allowed
authorFabrice Bellingard <bellingard@gmail.com>
Mon, 21 May 2012 06:51:18 +0000 (08:51 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Mon, 21 May 2012 09:35:56 +0000 (11:35 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/models/database_migration_manager.rb

index ba6da3894f424decc3baab97492cde7b650c6094..3b382a1b3245cb6aa7cdeba724111efba40634ab 100644 (file)
@@ -80,7 +80,7 @@ class ApplicationController < ActionController::Base
   protected
 
   def check_database_version
-    unless DatabaseVersion.uptodate?
+    unless DatabaseMigrationManager.instance.is_sonar_access_allowed?
       redirect_to :controller => 'maintenance', :action => 'index'
     end
   end
index 4f3072cac33aa7a54f2abb56cb18720f876ff127..a2b59ea9cfebb0f679963e536fe8f1940b31f5b3 100644 (file)
@@ -80,6 +80,10 @@ class DatabaseMigrationManager
     @status==MIGRATION_FAILED
   end
   
+  def is_sonar_access_allowed?
+    @status==NO_MIGRATION || @status==MIGRATION_SUCCEEDED
+  end
+  
   def migration_start_time
     @start_time
   end