diff --git a/app/controllers/env_controller.rb b/app/controllers/env_controller.rb index 0f34e15f..de61c704 100644 --- a/app/controllers/env_controller.rb +++ b/app/controllers/env_controller.rb @@ -5,6 +5,7 @@ class EnvController < ActionController::Base def index @site = Site.find_by_name('panel') - stale? @site + + stale? @site if @site end end diff --git a/app/views/env/index.js.haml b/app/views/env/index.js.haml index f4bd69cf..597ba53f 100644 --- a/app/views/env/index.js.haml +++ b/app/views/env/index.js.haml @@ -1,7 +1,8 @@ -= cache @site do - :plain - window.env = { - AIRBRAKE_SITE_ID: #{@site.id}, - AIRBRAKE_API_KEY: "#{@site.airbrake_api_key}", - PANEL_URL: "#{ENV['PANEL_URL']}" - } +- if @site + = cache @site do + :plain + window.env = { + AIRBRAKE_SITE_ID: #{@site.id}, + AIRBRAKE_API_KEY: "#{@site.airbrake_api_key}", + PANEL_URL: "#{ENV['PANEL_URL']}" + }