diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-04-24 19:02:23 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-07 15:30:12 +0100 |
commit | 28d1bb38e430588f0c19b2366cc14d52e98b02d0 (patch) | |
tree | 0f98910d7e1cc538bf4a9c5f6e87be32103ddcb4 | |
parent | 649204bef4fc7326e409640d403fb26d35e36d62 (diff) |
No access to update photos on hidden reports.
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Photo.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Photo.pm b/perllib/FixMyStreet/App/Controller/Photo.pm index 7b536a292..aeb40f520 100644 --- a/perllib/FixMyStreet/App/Controller/Photo.pm +++ b/perllib/FixMyStreet/App/Controller/Photo.pm @@ -52,10 +52,11 @@ sub index :LocalRegex('^(c/)?([1-9]\d*)(?:\.(\d+))?(?:\.(full|tn|fp))?\.(?:jpeg| my $item; if ( $is_update ) { ($item) = $c->model('DB::Comment')->search( { - id => $id, - state => 'confirmed', - photo => { '!=', undef }, - } ); + 'me.id' => $id, + 'me.state' => 'confirmed', + 'problem.state' => [ FixMyStreet::DB::Result::Problem->visible_states() ], + 'me.photo' => { '!=', undef }, + }, { prefetch => 'problem' }); } else { ($item) = $c->cobrand->problems->search( { id => $id, |