diff options
author | Struan Donald <struan@exo.org.uk> | 2012-03-20 15:26:40 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-03-20 15:26:40 +0000 |
commit | 95ffa6ce5fb32c09fcc389b69057a6abb0efec9a (patch) | |
tree | 483b888a14fda196a70afedb14e1f7cc7a929e25 /perllib/Open311/GetServiceRequestUpdates.pm | |
parent | a5c47e5cbec46fe162682f318d0d491acaf2ed6b (diff) |
make sure external ids for problems and comments are only unique per council
Diffstat (limited to 'perllib/Open311/GetServiceRequestUpdates.pm')
-rw-r--r-- | perllib/Open311/GetServiceRequestUpdates.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm index 7f0ca0520..53dd7722b 100644 --- a/perllib/Open311/GetServiceRequestUpdates.pm +++ b/perllib/Open311/GetServiceRequestUpdates.pm @@ -33,11 +33,13 @@ sub update_comments { my $problem = FixMyStreet::App->model('DB::Problem') - ->search( { external_id => $request_id, } ); + ->search( { + external_id => $request_id, + council => { like => '%' . $council_details->{areaid} . '%' }, + } ); if (my $p = $problem->first) { - my $c = FixMyStreet::App->model('DB::Comment') - ->search( { external_id => $request->{update_id} } ); + my $c = $p->comments->search( { external_id => $request->{update_id} } ); if ( !$c->first ) { my $comment = FixMyStreet::App->model('DB::Comment')->new( |