diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-05-27 22:51:11 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-05-27 22:51:11 +0100 |
commit | 9593e182ca601d8b8a3b4564e9072fa74473823c (patch) | |
tree | f62106f60fa65ed579525460f44276e7ec47cccd /perllib/FixMyStreet/App/Controller | |
parent | d9dc9503628a7d2727eb2d492c2f56b00c190c56 (diff) |
Pull request #97, merge multi_area_categories.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 736af16b1..dbefe9066 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -485,6 +485,7 @@ sub setup_categories_and_councils : Private { else { @contacts = keysort { $_->category } @contacts; + my %seen; foreach my $contact (@contacts) { push @area_ids_to_list, $contact->area_id; @@ -495,7 +496,9 @@ sub setup_categories_and_councils : Private { next if $contact->category eq _('Other'); - push @category_options, $contact->category; + push @category_options, $contact->category + unless $seen{$contact->category}; + $seen{$contact->category} = 1; } if (@category_options) { |