From 2bd592498f2cce965d685fe55f46c8a226190a79 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 23 Jun 2011 14:15:55 +0100 Subject: [PATCH] Don't try and update the session when we have no database --- app/views/site/index.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/site/index.html.erb b/app/views/site/index.html.erb index 0a0b7c1da..71567b2c5 100644 --- a/app/views/site/index.html.erb +++ b/app/views/site/index.html.erb @@ -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 -- 2.39.5