Skip to content

Commit b67f7fb

Browse files
committed
[WW] Don't send alert for cancels on cancelled container requests.
1 parent 249d2a5 commit b67f7fb

File tree

1 file changed

+9
-0
lines changed
  • perllib/FixMyStreet/App/Controller/Waste

1 file changed

+9
-0
lines changed

perllib/FixMyStreet/App/Controller/Waste/Echo.pm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ sub receive_echo_event_notification : Path('/waste/echo') : Args(0) {
108108
$updates->suppress_alerts(1);
109109
}
110110

111+
# If it's a cancellation update on a container request
112+
# that is already cancelled, don't send an alert as
113+
# we would have already sent one out for this.
114+
if ($p->category eq 'Request new container'
115+
&& $request->{status} eq 'cancelled'
116+
&& $p->state eq 'cancelled') {
117+
$updates->suppress_alerts(1);
118+
}
119+
111120
my $comment = $updates->process_update($request, $p);
112121
last;
113122
}

0 commit comments

Comments
 (0)