Don't try and update the session when we have no database
authorTom Hughes <tom@compton.nu>
Thu, 23 Jun 2011 13:15:55 +0000 (14:15 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 23 Jun 2011 13:15:55 +0000 (14:15 +0100)
app/views/site/index.html.erb

index 0a0b7c1da5e873a9e2a9a450dee08e963773d77a..71567b2c51da53adfa16c8b4ab7a9a7d45f1aebc 100644 (file)
@@ -95,7 +95,9 @@ elsif @user and !@user.home_lon.nil? and !@user.home_lat.nil?
     lat =  @user.home_lat
     zoom = '10'
 else
-    session[:location] = OSM::IPLocation(request.env['REMOTE_ADDR']) unless session[:location]
+    unless STATUS == :database_readonly or STATUS == :database_offline
+      session[:location] = OSM::IPLocation(request.env['REMOTE_ADDR']) unless session[:location]
+    end
 
     if session[:location]
         bbox = true