aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-06-27 18:10:33 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-07-15 12:30:31 +0100
commit4eede46db49e74581f39e33bcd5e11b8638eaa9b (patch)
treeb04e5430031326dfd65219e932dd15103d9344b5 /perllib/FixMyStreet/App/Controller
parent9e327d72fd7504c8f9f34dbdfd68856909446a40 (diff)
Remove bit of unused/needed code.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm27
1 files changed, 3 insertions, 24 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 5e6921ed9..71dbae83a 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -777,8 +777,7 @@ sub process_report : Private {
map { $_ => $c->get_param($_) }
(
'title', 'detail', 'pc', #
- 'detail_size', 'detail_depth',
- 'detail_offensive',
+ 'detail_size',
'may_show_name', #
'category', #
'subcategory', #
@@ -802,9 +801,8 @@ sub process_report : Private {
$report->title( Utils::cleanup_text( $params{title} ) );
my $detail = Utils::cleanup_text( $params{detail}, { allow_multiline => 1 } );
- for my $w ('depth', 'size', 'offensive') {
+ for my $w ('size') {
next unless $params{"detail_$w"};
- next if $params{"detail_$w"} eq '-- Please select --';
$detail .= "\n\n\u$w: " . $params{"detail_$w"};
}
$report->detail( $detail );
@@ -814,32 +812,13 @@ sub process_report : Private {
# set these straight from the params
$report->category( _ $params{category} ) if $params{category};
-
$report->subcategory( $params{subcategory} );
my $areas = $c->stash->{all_areas_mapit};
$report->areas( ',' . join( ',', sort keys %$areas ) . ',' );
- # From earlier in the process.
- $areas = $c->stash->{all_areas};
- my $bodies = $c->stash->{bodies};
- my $first_area = ( values %$areas )[0];
- my $first_body = ( values %$bodies )[0];
-
if ( $report->category ) {
-
- # FIXME All contacts were fetched in setup_categories_and_bodies,
- # so can this DB call also be avoided?
- my @contacts = $c-> #
- model('DB::Contact') #
- ->not_deleted #
- ->search(
- {
- body_id => [ keys %$bodies ],
- category => $report->category
- }
- )->all;
-
+ my @contacts = grep { $_->category eq $report->category } @{$c->stash->{contacts}};
unless ( @contacts ) {
$c->stash->{field_errors}->{category} = _('Please choose a category');
$report->bodies_str( -1 );