diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-11-18 14:05:56 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-11-18 14:35:21 +0000 |
commit | 5b3731b263864722f26c4ab9ce28209b089a6942 (patch) | |
tree | a3c8066d786f19b684677af5685fd587bf193ab7 /perllib/FixMyStreet/App/Controller/Moderate.pm | |
parent | 7b3c6513022a76409ae175187ecfb8064cff6e0d (diff) |
Remove cached photos before updating db field.
If the photo field is updated first, then the cache removal
doesn't think there are any photos to remove.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Moderate.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Moderate.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Moderate.pm b/perllib/FixMyStreet/App/Controller/Moderate.pm index 8a9f3b5a2..f4143f0b4 100644 --- a/perllib/FixMyStreet/App/Controller/Moderate.pm +++ b/perllib/FixMyStreet/App/Controller/Moderate.pm @@ -263,8 +263,8 @@ sub moderate_boolean : Private { if ($new != $old) { if ($thing eq 'photo') { - $object->$thing($new ? $original : undef); $object->get_photoset->delete_cached; + $object->$thing($new ? $original : undef); } else { $object->$thing($new); } |