aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Static.pm
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2015-08-26 13:43:10 +0200
committerMarius Halden <marius.h@lden.org>2015-08-26 13:43:10 +0200
commitcc0acdd34052e79f3df368ac1f524de31df19a1b (patch)
tree505f561b5f16c5b78f07514e8c2b2bdc18fef51d /perllib/FixMyStreet/App/Controller/Static.pm
parent1c5c685d0b0904e7ddc6e764e58e8fae08632d1d (diff)
parent6b84622fb7d58531baa7943abdcc7620999c34ee (diff)
Merge tag 'v1.6.1' into fiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Static.pm')
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Static.pm19
1 files changed, 19 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Static.pm b/perllib/FixMyStreet/App/Controller/Static.pm
index 8cd82b68e..d91a07fea 100755
--- a/perllib/FixMyStreet/App/Controller/Static.pm
+++ b/perllib/FixMyStreet/App/Controller/Static.pm
@@ -61,6 +61,25 @@ sub council : Global : Args(0) {
my ( $self, $c ) = @_;
}
+sub unresponsive : Global : Args(0) {
+ my ( $self, $c ) = @_;
+ my $body = $c->stash->{body} = $c->model('DB::Body')->find({ id => $c->get_param('body') })
+ or $c->detach( '/page_error_404_not_found' );
+
+ $c->stash->{category} = $c->get_param('category');
+
+ # If the whole body isn't set to refused, we need to check the contacts
+ if (!$body->send_method || $body->send_method ne 'Refused') {
+ my @contacts = $c->model('DB::Contact')->not_deleted->search( { body_id => $body->id } )->all;
+ my $any_unresponsive = 0;
+ foreach my $contact (@contacts) {
+ $any_unresponsive = 1 if $contact->email =~ /^REFUSED$/i;
+ }
+
+ $c->detach( '/page_error_404_not_found' ) unless $any_unresponsive;
+ }
+}
+
__PACKAGE__->meta->make_immutable;
1;