diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-10-06 14:07:53 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-10-11 16:17:32 +0100 |
commit | e1038dac8f5ba0fe2f20781468b3cbe763b7ed68 (patch) | |
tree | 92bac1075a1de16b80cc411b0add8b2aa11f38f6 /perllib/FixMyStreet/DB | |
parent | 9fc69a31cda118948e3714bc7f4fff9d0a3ca84e (diff) |
Fix bug in fetching existing shortlisted report.
It would always create a new report rather than return an existing one,
if present.
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 8d42d5926..7aa7a3272 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -355,7 +355,7 @@ sub adopt { around add_to_planned_reports => sub { my ( $orig, $self ) = ( shift, shift ); my ( $report_col ) = @_; - my $existing = $self->user_planned_reports->search_rs({ report_id => $report_col->{id}, removed => undef })->first; + my $existing = $self->user_planned_reports->search_rs({ report_id => $report_col->id, removed => undef })->first; return $existing if $existing; return $self->$orig(@_); }; |