aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App.pm1
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm4
-rw-r--r--perllib/FixMyStreet/App/Controller/Open311.pm2
-rw-r--r--perllib/FixMyStreet/App/Controller/Photo.pm2
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm2
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm4
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Rss.pm7
-rw-r--r--perllib/FixMyStreet/App/Engine.pm68
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm3
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm105
-rw-r--r--perllib/FixMyStreet/DB/Result/Comment.pm20
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm59
-rw-r--r--perllib/FixMyStreet/Roles/PhotoSet.pm34
-rw-r--r--perllib/FixMyStreet/Script/Reports.pm2
-rw-r--r--perllib/FixMyStreet/SendReport.pm6
15 files changed, 155 insertions, 164 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index 390300093..e47336b7c 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -98,7 +98,6 @@ __PACKAGE__->config(
);
__PACKAGE__->response_class('FixMyStreet::App::Response');
-__PACKAGE__->engine_class('FixMyStreet::App::Engine');
# Start the application
__PACKAGE__->setup();
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index e4932ecd5..ae7d83f55 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -284,11 +284,11 @@ sub map_features : Private {
Handle the ajax calls that the map makes when it is dragged. The info returned
is used to update the pins on the map and the text descriptions on the side of
-the map.
+the map. Used via /around?ajax=1 but also available at /ajax for mobile app.
=cut
-sub ajax : Private {
+sub ajax : Path('/ajax') {
my ( $self, $c ) = @_;
my $ret = $c->forward('/location/determine_location_from_bbox');
diff --git a/perllib/FixMyStreet/App/Controller/Open311.pm b/perllib/FixMyStreet/App/Controller/Open311.pm
index 95b29d116..c7e4e5bee 100644
--- a/perllib/FixMyStreet/App/Controller/Open311.pm
+++ b/perllib/FixMyStreet/App/Controller/Open311.pm
@@ -284,7 +284,7 @@ sub output_requests : Private {
my $display_photos = $c->cobrand->allow_photo_display($problem);
if ($display_photos && $problem->photo) {
my $url = $c->cobrand->base_url();
- my $imgurl = $url . $problem->photos->[0]->{url_full};
+ my $imgurl = $url . $problem->photos->[$display_photos-1]->{url_full};
$request->{'media_url'} = $imgurl;
}
push(@problemlist, $request);
diff --git a/perllib/FixMyStreet/App/Controller/Photo.pm b/perllib/FixMyStreet/App/Controller/Photo.pm
index 2302322bf..f41702dcf 100644
--- a/perllib/FixMyStreet/App/Controller/Photo.pm
+++ b/perllib/FixMyStreet/App/Controller/Photo.pm
@@ -63,7 +63,7 @@ sub index :LocalRegex('^(c/)?([1-9]\d*)(?:\.(\d+))?(?:\.(full|tn|fp))?\.(?:jpeg|
$c->detach( 'no_photo' ) unless $item;
- $c->detach( 'no_photo' ) unless $c->cobrand->allow_photo_display($item); # Should only be for reports, not updates
+ $c->detach( 'no_photo' ) unless $c->cobrand->allow_photo_display($item, $photo_number); # Should only be for reports, not updates
my $photo;
$photo = $item->get_photoset
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index d74af5a84..166c0614d 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -957,7 +957,7 @@ sub contacts_to_bodies : Private {
my @contacts = grep { $_->category eq $category } @{$c->stash->{contacts}};
- if ($c->stash->{unresponsive}{$category} || $c->stash->{unresponsive}{ALL}) {
+ if ($c->stash->{unresponsive}{$category} || $c->stash->{unresponsive}{ALL} || !@contacts) {
[];
} else {
if ( $c->cobrand->call_hook('singleton_bodies_str') ) {
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 8550b745b..7c3796c42 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -440,7 +440,7 @@ sub summary : Private {
# required to stop errors in generate_grouped_data
$c->stash->{q_state} = '';
- $c->stash->{ward} = $c->get_param('ward');
+ $c->stash->{ward} = $c->get_param('area');
$c->stash->{start_date} = $dtf->format_date($start_date);
$c->stash->{end_date} = $c->get_param('end_date');
@@ -494,7 +494,7 @@ sub export_summary_csv : Private {
'postcode',
'url',
],
- filename => 'fixmystreet-data.csv',
+ filename => 'fixmystreet-data',
};
$c->forward('/dashboard/generate_csv');
}
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm
index 7cf4783c0..e1da4445d 100755
--- a/perllib/FixMyStreet/App/Controller/Rss.pm
+++ b/perllib/FixMyStreet/App/Controller/Rss.pm
@@ -282,14 +282,15 @@ sub add_row : Private {
$item{pubDate} = $pubDate if $pubDate;
$item{category} = encode_entities($row->{category}) if $row->{category};
- if ($c->cobrand->allow_photo_display($row) && $row->{photo}) {
+ if ((my $photo_to_show = $c->cobrand->allow_photo_display($row)) && $row->{photo}) {
# Bit yucky as we don't have full objects here
my $photoset = FixMyStreet::App::Model::PhotoSet->new({ db_data => $row->{photo} });
- my $first_fn = $photoset->get_id(0);
+ my $idx = $photo_to_show - 1;
+ my $first_fn = $photoset->get_id($idx);
my ($hash, $format) = split /\./, $first_fn;
my $cachebust = substr($hash, 0, 8);
my $key = $alert_type->item_table eq 'comment' ? 'c/' : '';
- $item{description} .= encode_entities("\n<br><img src=\"". $base_url . "/photo/$key$row->{id}.0.$format?$cachebust\">");
+ $item{description} .= encode_entities("\n<br><img src=\"". $base_url . "/photo/$key$row->{id}.$idx.$format?$cachebust\">");
}
if ( $row->{used_map} ) {
diff --git a/perllib/FixMyStreet/App/Engine.pm b/perllib/FixMyStreet/App/Engine.pm
deleted file mode 100644
index b73701f49..000000000
--- a/perllib/FixMyStreet/App/Engine.pm
+++ /dev/null
@@ -1,68 +0,0 @@
-package FixMyStreet::App::Engine;
-
-use Moose;
-extends 'Catalyst::Engine';
-
-use CGI::Cookie;
-use utf8;
-
-use namespace::clean -except => 'meta';
-
-=head1 NAME
-
-FixMyStreet::App::Engine - Catalyst Engine wrapper
-
-=head1 SYNOPSIS
-
-See L<Catalyst::Engine>.
-
-=head1 METHODS
-
-=head2 $self->finalize_cookies($c)
-
-Create CGI::Cookie objects from C<< $c->res->cookies >>, and set them as
-response headers. Adds a C<samesite=lax> part.
-
-=cut
-
-sub finalize_cookies {
- my ( $self, $c ) = @_;
-
- my @cookies;
- my $response = $c->response;
-
- foreach my $name (keys %{ $response->cookies }) {
-
- my $val = $response->cookies->{$name};
-
- my $cookie = (
- blessed($val)
- ? $val
- : CGI::Cookie->new(
- -name => $name,
- -value => $val->{value},
- -expires => $val->{expires},
- -domain => $val->{domain},
- -path => $val->{path},
- -secure => $val->{secure} || 0,
- -httponly => $val->{httponly} || 0,
- -samesite => 'Lax',
- )
- );
- if (!defined $cookie) {
- $c->log->warn("undef passed in '$name' cookie value - not setting cookie")
- if $c->debug;
- next;
- }
-
- push @cookies, $cookie->as_string;
- }
-
- for my $cookie (@cookies) {
- $response->headers->push_header( 'Set-Cookie' => $cookie );
- }
-}
-
-__PACKAGE__->meta->make_immutable;
-
-1;
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 4c521eaaa..7888f8ccf 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -465,11 +465,12 @@ sub allow_photo_upload { return 1; }
=item allow_photo_display
Return a boolean indicating whether the cobrand allows photo display
+for the particular report and photo.
=cut
sub allow_photo_display {
- my ( $self, $r ) = @_;
+ my ( $self, $r, $num ) = @_;
return 1;
}
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 4dc95b178..f0308d6d7 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -4,6 +4,7 @@ use base 'FixMyStreet::Cobrand::Default';
use DateTime;
use POSIX qw(strcoll);
use RABX;
+use List::Util qw(min);
use Scalar::Util 'blessed';
use DateTime::Format::Pg;
@@ -223,19 +224,30 @@ sub updates_as_hashref {
return $hashref;
}
+# If $num is undefined, we want to return the minimum photo number that can be
+# shown (1-indexed), or false for no display. If $num is defined, return
+# boolean whether that indexed photo can be shown.
sub allow_photo_display {
- my ( $self, $r ) = @_;
+ my ( $self, $r, $num ) = @_;
+ my $publish_photo;
if (blessed $r) {
- return $r->get_extra_metadata( 'publish_photo' );
+ $publish_photo = $r->get_extra_metadata('publish_photo');
+ } else {
+ # additional munging in case $r isn't an object, TODO see if we can remove this
+ my $extra = $r->{extra};
+ utf8::encode($extra) if utf8::is_utf8($extra);
+ my $h = new IO::String($extra);
+ $extra = RABX::wire_rd($h);
+ return unless ref $extra eq 'HASH';
+ $publish_photo = $extra->{publish_photo};
}
+ # Old style stored 1/0 integer, which can still be used if present.
+ return $publish_photo unless ref $publish_photo;
+ return $publish_photo->{$num} if defined $num;
- # additional munging in case $r isn't an object, TODO see if we can remove this
- my $extra = $r->{extra};
- utf8::encode($extra) if utf8::is_utf8($extra);
- my $h = new IO::String($extra);
- $extra = RABX::wire_rd($h);
- return unless ref $extra eq 'HASH';
- return $extra->{publish_photo};
+ # We return a 1-indexed number so that '0' can be taken as 'not allowed'
+ my $i = min grep { $publish_photo->{$_} } keys %$publish_photo;
+ return $i + 1;
}
sub show_unconfirmed_reports {
@@ -250,12 +262,27 @@ sub get_body_sender {
# Report overdue functions
my %public_holidays = map { $_ => 1 } (
- '2013-01-01', '2013-01-02', '2013-03-29', '2013-04-01',
- '2013-04-15', '2013-05-01', '2013-05-09', '2013-05-20',
- '2013-08-01', '2013-09-09', '2013-12-25', '2013-12-26',
- '2014-01-01', '2014-01-02', '2014-04-18', '2014-04-21',
- '2014-04-28', '2014-05-01', '2014-05-29', '2014-06-09',
- '2014-08-01', '2014-09-15', '2014-12-25', '2014-12-26',
+ # New Year's Day, Saint Berchtold, Good Friday, Easter Monday,
+ # Sechseläuten, Labour Day, Ascension Day, Whit Monday,
+ # Swiss National Holiday, Knabenschiessen, Christmas, St Stephen's Day
+ # Extra holidays
+
+ '2018-01-01', '2018-01-02', '2018-03-30', '2018-04-02',
+ '2018-04-16', '2018-05-01', '2018-05-10', '2018-05-21',
+ '2018-08-01', '2018-09-10', '2018-12-25', '2018-12-26',
+ '2018-03-29', '2018-05-11', '2018-12-27', '2018-12-28', '2018-12-31',
+
+ '2019-01-01', '2019-01-02', '2019-04-19', '2019-04-22',
+ '2019-04-08', '2019-05-01', '2019-05-30', '2019-06-10',
+ '2019-08-01', '2019-09-09', '2019-12-25', '2019-12-26',
+
+ '2020-01-01', '2020-01-02', '2020-04-10', '2020-04-13',
+ '2020-04-20', '2020-05-01', '2020-05-21', '2020-06-01',
+ '2020-09-14', '2020-12-25',
+
+ '2021-01-01', '2021-04-02', '2021-04-05',
+ '2021-04-19', '2021-05-13', '2021-05-24',
+ '2021-09-13',
);
sub is_public_holiday {
@@ -566,7 +593,19 @@ sub admin_report_edit {
# Problem updates upon submission
if ( ($type eq 'super' || $type eq 'dm') && $c->get_param('submit') ) {
- $problem->set_extra_metadata('publish_photo' => $c->get_param('publish_photo') || 0 );
+
+ my @keys = grep { /^publish_photo/ } keys %{ $c->req->params };
+ my %publish_photo;
+ foreach my $key (@keys) {
+ my ($index) = $key =~ /(\d+)$/;
+ $publish_photo{$index} = 1 if $c->get_param($key);
+ }
+
+ if (%publish_photo) {
+ $problem->set_extra_metadata('publish_photo' => \%publish_photo);
+ } else {
+ $problem->unset_extra_metadata('publish_photo');
+ }
$problem->set_extra_metadata('third_personal' => $c->get_param('third_personal') || 0 );
# Make sure we have a copy of the original detail field
@@ -1005,23 +1044,28 @@ sub _admin_send_email {
sub munge_sendreport_params {
my ($self, $row, $h, $params) = @_;
- if ($row->state =~ /^(closed|investigating)$/ && $row->get_extra_metadata('publish_photo')) {
+
+ if ($row->state =~ /^(closed|investigating)$/) {
# we attach images to reports sent to external bodies
my $photoset = $row->get_photoset();
my $num = $photoset->num_images
or return;
my $id = $row->id;
my @attachments = map {
- my $image = $photoset->get_raw_image($_);
- {
- body => $image->{data},
- attributes => {
- filename => "$id.$_." . $image->{extension},
- content_type => $image->{content_type},
- encoding => 'base64',
- # quoted-printable ends up with newlines corrupting binary data
- name => "$id.$_." . $image->{extension},
- },
+ if ($self->allow_photo_display($row, $_)) {
+ my $image = $photoset->get_raw_image($_);
+ {
+ body => $image->{data},
+ attributes => {
+ filename => "$id.$_." . $image->{extension},
+ content_type => $image->{content_type},
+ encoding => 'base64',
+ # quoted-printable ends up with newlines corrupting binary data
+ name => "$id.$_." . $image->{extension},
+ },
+ };
+ } else {
+ ();
}
} (0..$num-1);
$params->{_attachments_} = \@attachments;
@@ -1165,7 +1209,10 @@ sub admin_stats {
$public_response =~ s{\r?\n}{ <br/> }g if $public_response;
# Assemble photo URL, if report has a photo
- my $media_url = ( @{$report->photos} && $c->cobrand->allow_photo_display($report) ) ? ($c->cobrand->base_url . $report->photos->[0]->{url}) : '';
+ my $photo_to_display = $c->cobrand->allow_photo_display($report);
+ my $media_url = (@{$report->photos} && $photo_to_display)
+ ? $c->cobrand->base_url . $report->photos->[$photo_to_display-1]->{url}
+ : '';
my @columns = (
$report->id,
@@ -1231,7 +1278,7 @@ sub admin_stats {
# pictures taken
my $pictures_taken = $c->model('DB::Problem')->search( { photo => { '!=', undef }, %params } )->count;
# pictures published
- my $pictures_published = $c->model('DB::Problem')->search( { extra => { like => '%publish_photo,I1:1%' }, %params } )->count;
+ my $pictures_published = $c->model('DB::Problem')->search( { extra => { like => '%publish_photo%' }, %params } )->count;
# how many times was a telephone number provided
# XXX => How many users have a telephone number stored
# my $phone = $c->model('DB::User')->search( { phone => { '!=', undef } } )->count;
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm
index ce4fc216a..8a4dbe475 100644
--- a/perllib/FixMyStreet/DB/Result/Comment.pm
+++ b/perllib/FixMyStreet/DB/Result/Comment.pm
@@ -156,26 +156,6 @@ sub url {
return "/report/" . $self->problem_id . '#update_' . $self->id;
}
-sub photos {
- my $self = shift;
- my $photoset = $self->get_photoset;
- my $i = 0;
- my $id = $self->id;
- my @photos = map {
- my $cachebust = substr($_, 0, 8);
- my ($hash, $format) = split /\./, $_;
- {
- id => $hash,
- url_temp => "/photo/temp.$hash.$format",
- url_temp_full => "/photo/fulltemp.$hash.$format",
- url => "/photo/c/$id.$i.$format?$cachebust",
- url_full => "/photo/c/$id.$i.full.$format?$cachebust",
- idx => $i++,
- }
- } $photoset->all_ids;
- return \@photos;
-}
-
=head2 latest_moderation_log_entry
Return most recent ModerationLog object
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 8625bf17a..c73f7efca 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -867,6 +867,33 @@ sub update_send_failed {
} );
}
+=head2 updates_sent_to_body
+
+Returns 1 if updates left on this report will be sent to any of the receiving
+bodies by some mechanism. Right now that mechanism is Open311.
+
+=cut
+
+sub updates_sent_to_body {
+ my $self = shift;
+ return unless $self->send_method_used && $self->send_method_used eq 'Open311';
+
+ # Some bodies only send updates *to* FMS, they don't receive updates.
+ # NB See also the list in bin/send-comments
+ my $excluded = qr{Lewisham|Oxfordshire};
+
+ my @bodies = values %{ $self->bodies };
+ my @updates_sent = grep {
+ $_->send_comments &&
+ (
+ $_->send_method eq 'Open311' ||
+ $_->send_method eq 'Noop' # Sending might be temporarily disabled
+ ) &&
+ !($_->name =~ /$excluded/)
+ } @bodies;
+ return scalar @updates_sent;
+}
+
sub add_send_method {
my $self = shift;
my $sender = shift;
@@ -919,38 +946,6 @@ sub latest_moderation_log_entry {
return $self->admin_log_entries->search({ action => 'moderation' }, { order_by => { -desc => 'id' } })->first;
}
-sub photos {
- my $self = shift;
- my $photoset = $self->get_photoset;
- my $i = 0;
- my $id = $self->id;
- my @photos = map {
- my $cachebust = substr($_, 0, 8);
- # Some Varnish configurations (e.g. on mySociety infra) strip cookies from
- # images, which means image requests will be redirected to the login page
- # if LOGIN_REQUIRED is set. To stop this happening, Varnish should be
- # configured to not strip cookies if the cookie_passthrough param is
- # present, which this line ensures will be if LOGIN_REQUIRED is set.
- my $extra = '';
- if (FixMyStreet->config('LOGIN_REQUIRED')) {
- $cachebust .= '&cookie_passthrough=1';
- $extra = '?cookie_passthrough=1';
- }
- my ($hash, $format) = split /\./, $_;
- {
- id => $hash,
- url_temp => "/photo/temp.$hash.$format$extra",
- url_temp_full => "/photo/fulltemp.$hash.$format$extra",
- url => "/photo/$id.$i.$format?$cachebust",
- url_full => "/photo/$id.$i.full.$format?$cachebust",
- url_tn => "/photo/$id.$i.tn.$format?$cachebust",
- url_fp => "/photo/$id.$i.fp.$format?$cachebust",
- idx => $i++,
- }
- } $photoset->all_ids;
- return \@photos;
-}
-
__PACKAGE__->has_many(
"admin_log_entries",
"FixMyStreet::DB::Result::AdminLog",
diff --git a/perllib/FixMyStreet/Roles/PhotoSet.pm b/perllib/FixMyStreet/Roles/PhotoSet.pm
index 9607b5049..2a6863cff 100644
--- a/perllib/FixMyStreet/Roles/PhotoSet.pm
+++ b/perllib/FixMyStreet/Roles/PhotoSet.pm
@@ -32,4 +32,38 @@ sub get_first_image_fp {
return $self->get_photoset->get_image_data( num => 0, size => 'fp' );
}
+sub photos {
+ my $self = shift;
+ my $photoset = $self->get_photoset;
+ my $i = 0;
+ my $id = $self->id;
+ my $typ = $self->result_source->name eq 'comment' ? 'c/' : '';
+
+ my @photos = map {
+ my $cachebust = substr($_, 0, 8);
+ # Some Varnish configurations (e.g. on mySociety infra) strip cookies from
+ # images, which means image requests will be redirected to the login page
+ # if LOGIN_REQUIRED is set. To stop this happening, Varnish should be
+ # configured to not strip cookies if the cookie_passthrough param is
+ # present, which this line ensures will be if LOGIN_REQUIRED is set.
+ my $extra = '';
+ if (FixMyStreet->config('LOGIN_REQUIRED')) {
+ $cachebust .= '&cookie_passthrough=1';
+ $extra = '?cookie_passthrough=1';
+ }
+ my ($hash, $format) = split /\./, $_;
+ {
+ id => $hash,
+ url_temp => "/photo/temp.$hash.$format$extra",
+ url_temp_full => "/photo/fulltemp.$hash.$format$extra",
+ url => "/photo/$typ$id.$i.$format?$cachebust",
+ url_full => "/photo/$typ$id.$i.full.$format?$cachebust",
+ url_tn => "/photo/$typ$id.$i.tn.$format?$cachebust",
+ url_fp => "/photo/$typ$id.$i.fp.$format?$cachebust",
+ idx => $i++,
+ }
+ } $photoset->all_ids;
+ return \@photos;
+}
+
1;
diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm
index aca894d03..7e14fbb1e 100644
--- a/perllib/FixMyStreet/Script/Reports.pm
+++ b/perllib/FixMyStreet/Script/Reports.pm
@@ -159,7 +159,7 @@ sub send(;$) {
}
}
- if ( $reporters{ $sender }->should_skip( $row ) ) {
+ if ( $reporters{ $sender }->should_skip( $row, $debug_mode ) ) {
$skip = 1;
debug_print("skipped by sender " . $sender_info->{method} . " (might be due to previous failed attempts?)", $row->id) if $debug_mode;
} else {
diff --git a/perllib/FixMyStreet/SendReport.pm b/perllib/FixMyStreet/SendReport.pm
index 40ec4caf2..2739e3043 100644
--- a/perllib/FixMyStreet/SendReport.pm
+++ b/perllib/FixMyStreet/SendReport.pm
@@ -19,10 +19,12 @@ has 'unconfirmed_notes' => ( 'is' => 'rw', isa => HashRef, default => sub { {} }
sub should_skip {
- my $self = shift;
- my $row = shift;
+ my $self = shift;
+ my $row = shift;
+ my $debug = shift;
return 0 unless $row->send_fail_count;
+ return 0 if $debug;
my $now = DateTime->now( time_zone => FixMyStreet->local_time_zone );
my $diff = $now - $row->send_fail_timestamp;