diff options
author | Dave Arter <davea@mysociety.org> | 2019-10-11 15:25:59 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2019-12-09 12:48:12 +0000 |
commit | e9fb01d6be50fcec63812ad9168bc92ce0f99de9 (patch) | |
tree | 7276fa449cdfd6082e2972419a1b8d457271ab97 | |
parent | 794ff2de7d31a3b7b492cdfe9f0273b8c9468d14 (diff) |
[TfL] Only display TfL as the destination body when making reports.
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Body.pm | 11 | ||||
-rw-r--r-- | templates/web/tfl/report/new/top_message.html | 0 |
2 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm index afbeda88a..29ce67204 100644 --- a/perllib/FixMyStreet/DB/Result/Body.pm +++ b/perllib/FixMyStreet/DB/Result/Body.pm @@ -224,6 +224,17 @@ has a council_name, use it in preference to the body name. sub cobrand_name { my $self = shift; + + # Because TfL covers all the boroughs in London, get_cobrand_handler + # may return another London cobrand if it is listed before tfl in + # ALLOWED_COBRANDS, because one of this body's area_ids will also + # match that cobrand's council_area_id. This leads to odd things like + # councils_text_all.html showing a message like "These will be sent to + # Bromley Council" when making a report within Westminster on the TfL + # cobrand. + # If the current body is TfL then we always want to show TfL as the cobrand name. + return $self->name if $self->name eq 'TfL'; + my $handler = $self->get_cobrand_handler; if ($handler && $handler->can('council_name')) { return $handler->council_name; diff --git a/templates/web/tfl/report/new/top_message.html b/templates/web/tfl/report/new/top_message.html new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/templates/web/tfl/report/new/top_message.html |