Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Bromley] No updates on closed waste reports.
  • Loading branch information
dracos committed Jun 29, 2020
1 parent 9d53b76 commit b15f1fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions perllib/FixMyStreet/Cobrand/Bromley.pm
Expand Up @@ -394,6 +394,19 @@ sub munge_report_new_contacts {
$self->SUPER::munge_report_new_contacts($categories);
}

sub updates_disallowed {
my $self = shift;
my ($problem) = @_;

# Only open waste reports
if (my $contact = $problem->contact) {
my $waste = grep { $_ eq 'Waste' } @{$problem->contact->groups};
return 1 if $waste && ($problem->is_fixed || $problem->is_closed);
}

return $self->next::method(@_);
}

sub bin_addresses_for_postcode {
my $self = shift;
my $pc = shift;
Expand Down
3 changes: 3 additions & 0 deletions t/app/controller/waste.t
Expand Up @@ -97,8 +97,11 @@ FixMyStreet::override_config {
is $res->code, 403;
$mech->log_in_ok($user->email);
$mech->get_ok('/report/' . $report->id);
$mech->content_contains('Provide an update');
$report->update({ state => 'fixed - council' });
$mech->log_in_ok($staff_user->email);
$mech->get_ok('/report/' . $report->id);
$mech->content_lacks('Provide an update');

$mech->host('www.fixmystreet.com');
$res = $mech->get('/report/' . $report->id);
Expand Down

0 comments on commit b15f1fa

Please sign in to comment.