aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-07-18 17:25:29 +0100
committerDave Arter <davea@mysociety.org>2019-08-16 14:25:12 +0100
commit10b22ec7ad2a4882de6b7eaff7aa8db739f8c411 (patch)
tree6abe9412d927c9cd843d9e0c01a246eb54b052c8 /perllib/FixMyStreet
parent078fd554ce03e360adaaced638cb7771bee5165c (diff)
Tidy up closed_updates/updates_disallowed a bit.
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm3
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm13
2 files changed, 14 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index d67ead82d..1825286ca 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -244,8 +244,7 @@ This makes sure we only proceed to processing if we've had the form submitted
sub check_form_submitted : Private {
my ( $self, $c ) = @_;
- return if $c->stash->{problem}->get_extra_metadata('closed_updates');
- return if $c->cobrand->call_hook(updates_disallowed => $c->stash->{problem});
+ return if $c->cobrand->updates_disallowed($c->stash->{problem});
return $c->get_param('submit_update') || '';
}
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index d7bec65cd..a6c6f34c4 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -503,6 +503,19 @@ allowing them to report them as offensive.
sub allow_update_reporting { return 0; }
+=item updates_disallowed
+
+Returns a boolean indicating whether updates on a particular report are allowed
+or not. Default behaviour is disallowed if "closed_updates" metadata is set.
+
+=cut
+
+sub updates_disallowed {
+ my ($self, $problem) = @_;
+ return 1 if $problem->get_extra_metadata('closed_updates');
+ return 0;
+}
+
=item geocode_postcode
Given a QUERY, return LAT/LON and/or ERROR.