Skip to content

Commit

Permalink
[Bromley] Actually only resend non-waste Echo reports.
Browse files Browse the repository at this point in the history
Used wrong field in 21b8c7f.
  • Loading branch information
dracos committed Oct 16, 2024
1 parent df7b21d commit f122336
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion perllib/FixMyStreet/Cobrand/Bromley.pm
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ sub should_skip_sending_update {
my ($self, $update) = @_;

my $report = $update->problem;
if ($self->_has_report_been_sent_to_echo($report) && $report->cobrand ne 'waste') {
if ($self->_has_report_been_sent_to_echo($report) && $report->cobrand_data ne 'waste') {
# We need to know whether to treat this as a normal update or a referral.
# We have the GUID but not the ID so we look this up.
my $cfg = $self->feature('echo');
Expand Down
14 changes: 14 additions & 0 deletions t/cobrand/bromley.t
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ subtest 'redirecting of reports between backends' => sub {
user => $user,
mark_open => 1,
});
$report->cobrand_data('waste');
$report->update;
FixMyStreet::override_config {
ALLOWED_COBRANDS => 'bromley',
Expand All @@ -898,6 +899,19 @@ subtest 'redirecting of reports between backends' => sub {
$updates->send;
};

$comment->discard_changes;
is $comment->send_state, 'unprocessed', "did not send";

$comment->update({ send_fail_count => 0 });
$report->update({ cobrand_data => '' });

FixMyStreet::override_config {
ALLOWED_COBRANDS => 'bromley',
}, sub {
my $updates = Open311::PostServiceRequestUpdates->new();
$updates->send;
};

$report->discard_changes;
is $report->get_extra_metadata('open311_category_override'), 'Street Services', 'category override applied';
is $report->get_extra_metadata('external_status_code'), undef;
Expand Down

0 comments on commit f122336

Please sign in to comment.