aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Moderate.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-11-18 14:05:56 +0000
committerMatthew Somerville <matthew@mysociety.org>2019-11-18 14:35:21 +0000
commit5b3731b263864722f26c4ab9ce28209b089a6942 (patch)
treea3c8066d786f19b684677af5685fd587bf193ab7 /perllib/FixMyStreet/App/Controller/Moderate.pm
parent7b3c6513022a76409ae175187ecfb8064cff6e0d (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.pm2
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);
}