aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport/Email.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-07-23 11:13:35 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-07-23 11:13:35 +0100
commit5fa680e52ffe8cfe7aa7b06fd96b8bce61095418 (patch)
treebfa0c40d4884b71456da4af9d6597a1391dd03f0 /perllib/FixMyStreet/SendReport/Email.pm
parent1d22165ba38a91daa74e52ac67dd75974abdaecb (diff)
Return correct failure code if no recipients.
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Email.pm')
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm
index dec204b1c..404622e9c 100644
--- a/perllib/FixMyStreet/SendReport/Email.pm
+++ b/perllib/FixMyStreet/SendReport/Email.pm
@@ -59,11 +59,14 @@ sub send {
my @recips = $self->build_recipient_list( $row, $h );
# on a staging server send emails to ourselves rather than the councils
- if (mySociety::Config::get('STAGING_SITE')) {
+ if (mySociety::Config::get('STAGING_SITE') && !FixMyStreet->test_mode) {
@recips = ( mySociety::Config::get('CONTACT_EMAIL') );
}
- return unless @recips;
+ unless ( @recips ) {
+ $self->error( 'No recipients' );
+ return 1;
+ }
my ($verbose, $nomail) = CronFns::options();
my $result = FixMyStreet::App->send_email_cron(