diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-11-21 13:31:13 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-11-21 13:31:13 +0000 |
commit | aae9e8e3d28e3c1f6d4d92199d08a540f30316bd (patch) | |
tree | 6905979a0ee715370e221445cbe4447665a414ce /bin/update-all-reports | |
parent | 652d9a21109e7c54891496f23572b87759362106 (diff) |
Fix update-all-reports for all bodies generation.
Only works on bodies with an associated area, and requires the
object to be passed in, not just its ID.
Diffstat (limited to 'bin/update-all-reports')
-rwxr-xr-x | bin/update-all-reports | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/update-all-reports b/bin/update-all-reports index 0f9231f87..1225a4c08 100755 --- a/bin/update-all-reports +++ b/bin/update-all-reports @@ -39,7 +39,8 @@ if ($opt->table) { } elsif ($opt->all_bodies) { my $bodies = FixMyStreet::DB->resultset("Body")->search({ deleted => 0 }); while (my $body = $bodies->next) { - my $data = FixMyStreet::Script::UpdateAllReports::generate_dashboard($body->id); + next unless $body->body_areas->first; + my $data = FixMyStreet::Script::UpdateAllReports::generate_dashboard($body); output("all-reports-dashboard-" . $body->id, $data); } } elsif (my $body_id = $opt->body) { |