diff options
author | Struan Donald <struan@exo.org.uk> | 2012-04-03 17:39:58 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-04-03 17:39:58 +0100 |
commit | b1e64aad7422ddeae0fde7f5f2a41eae151d830f (patch) | |
tree | 403619996b1462118113c9a97987bbfac429a692 /perllib/FixMyStreet | |
parent | 48df97a7f969aba3852cb8f65d00d73cee87dc32 (diff) |
get send method from open311 conf table
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FixMyStreet.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm index 6c0089d26..a0aa6db45 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm @@ -9,12 +9,14 @@ sub restriction { sub get_council_sender { my ( $self, $area_id, $area_info ) = shift; - my $sender_conf = mySociety::Config::get( 'SENDERS' ); - return $sender_conf->{ $council } if exists $sender_conf->{ $council }; + my $send_method; - return 'London' if $area_info->{type} eq 'LBO'; + my $council_config = FixMyStreet::App->model("DB::Open311conf")->search( { area_id => $area_id } )->first; + $send_method = $council_config->send_method if $council_config; + + return $send_method if $send_method; - return 'Open311' if FixMyStreet::App->model("DB::Open311conf")->search( { area_id => $council, endpoint => { '!=', '' } } )->first; + return 'London' if $area_info->{type} eq 'LBO'; return 'Email'; } |