diff options
author | Struan Donald <struan@exo.org.uk> | 2018-03-01 12:31:48 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-03-15 14:49:00 +0000 |
commit | 8c23490f465fad0089d77ee362c566d066798d09 (patch) | |
tree | 91b6c9612f575b3ef68b742deb5f30b89351ce4b /perllib/Open311/GetServiceRequestUpdates.pm | |
parent | 7b790604611322af72ac851ce0935587152d052f (diff) |
permit blank updates to be fetched over Open311
Add a per body configuration option to allow Open311 updates to contain
only a status change, rather than emitting a warning when this happens.
Diffstat (limited to 'perllib/Open311/GetServiceRequestUpdates.pm')
-rw-r--r-- | perllib/Open311/GetServiceRequestUpdates.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm index 8e83d08b9..f2a319f15 100644 --- a/perllib/Open311/GetServiceRequestUpdates.pm +++ b/perllib/Open311/GetServiceRequestUpdates.pm @@ -12,6 +12,7 @@ has end_date => ( is => 'ro', default => sub { undef } ); has suppress_alerts => ( is => 'rw', default => 0 ); has verbose => ( is => 'ro', default => 0 ); has schema => ( is =>'ro', lazy => 1, default => sub { FixMyStreet::DB->schema->connect } ); +has blank_updates_permitted => ( is => 'rw', default => 0 ); Readonly::Scalar my $AREA_ID_BROMLEY => 2482; Readonly::Scalar my $AREA_ID_OXFORDSHIRE => 2237; @@ -49,6 +50,7 @@ sub fetch { } $self->suppress_alerts( $body->suppress_alerts ); + $self->blank_updates_permitted( $body->blank_updates_permitted ); $self->system_user( $body->comment_user ); $self->update_comments( $o, $body ); } @@ -183,6 +185,8 @@ sub comment_text_for_request { return $template->text; } + return "" if $self->blank_updates_permitted; + print STDERR "Couldn't determine update text for $request->{update_id} (report " . $problem->id . ")\n"; return ""; } |