aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/public_body.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/public_body.rb')
-rw-r--r--app/models/public_body.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index e9a90bce3..d212c371f 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -509,6 +509,20 @@ class PublicBody < ActiveRecord::Base
return self.request_email_domain
end
+ # Returns nil if configuration variable not set
+ def override_request_email
+ e = MySociety::Config.get("OVERRIDE_ALL_PUBLIC_BODY_REQUEST_EMAILS", "")
+ e if e != ""
+ end
+
+ def request_email
+ if override_request_email
+ override_request_email
+ else
+ read_attribute(:request_email)
+ end
+ end
+
# Domain name of the request email
def request_email_domain
return PublicBody.extract_domain_from_email(self.request_email)