diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-10-17 15:05:37 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-10-17 15:05:37 +0100 |
commit | c8a203e221a55a5653596f5a8e092bd3877df9c4 (patch) | |
tree | 3de4ac1214eca2c12a357e5f338b0d3055e79721 /app/models/public_body.rb | |
parent | e6dc0f6606b26e13cb0cd16124fdb2aad3c1b5a6 (diff) | |
parent | cc7bc36d5748c9baa0cfd8e44395923cc5792f32 (diff) |
Merge branch 'release/0.6.7'
Conflicts:
locale/cs/app.po
locale/ro_RO/app.po
Diffstat (limited to 'app/models/public_body.rb')
-rw-r--r-- | app/models/public_body.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 2cf1ce8a2..34bcd332c 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -336,7 +336,7 @@ class PublicBody < ActiveRecord::Base pb = PublicBody.new( :name => 'Internal admin authority', :short_name => "", - :request_email => MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost'), + :request_email => Configuration::contact_email, :home_page => "", :notes => "", :publication_scheme => "", @@ -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 = Configuration::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) |