diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Model')
-rw-r--r-- | perllib/FixMyStreet/App/Model/PhotoSet.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Model/PhotoSet.pm b/perllib/FixMyStreet/App/Model/PhotoSet.pm index b44bf4b38..030dbd5be 100644 --- a/perllib/FixMyStreet/App/Model/PhotoSet.pm +++ b/perllib/FixMyStreet/App/Model/PhotoSet.pm @@ -255,9 +255,11 @@ sub delete_cached { my ($self) = @_; my $object = $self->object or return; + my @dirs = ('web', 'photo'); + push @dirs, 'c' if ref $object eq 'FixMyStreet::DB::Result::Comment'; + unlink glob FixMyStreet->path_to( - 'web', - 'photo', + @dirs, $object->id . '.*' ); } |