aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2012-09-27 15:51:26 +1000
committerMatthew Landauer <matthew@openaustralia.org>2012-09-27 15:51:26 +1000
commitdff4c6c0ef55a28e303d1e767f92545cb2ad0214 (patch)
tree2a5c83494edeb6fcede306b33dde1743cae506b4 /app/models
parentda5c9b6d2e832b1747d105c985d521bc4c05d593 (diff)
override_request_email returns nil if configuration not set
Diffstat (limited to 'app/models')
-rw-r--r--app/models/public_body.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index d1ed74110..841e1e881 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -509,12 +509,14 @@ class PublicBody < ActiveRecord::Base
return self.request_email_domain
end
+ # Returns nil if configuration variable not set
def override_request_email
- MySociety::Config.get("OVERRIDE_ALL_PUBLIC_BODY_REQUEST_EMAILS", "")
+ e = MySociety::Config.get("OVERRIDE_ALL_PUBLIC_BODY_REQUEST_EMAILS", "")
+ e if e != ""
end
def request_email
- if override_request_email != ""
+ if override_request_email
override_request_email
else
read_attribute(:request_email)