diff options
author | Dave Arter <davea@mysociety.org> | 2020-01-06 11:01:59 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2020-01-06 11:03:13 +0000 |
commit | 64944ca56e310f256536b94065542141f1341a8b (patch) | |
tree | fffd07196d27c5f06ecd9c649874b4de087c27db /perllib/FixMyStreet/App/Controller | |
parent | 9d876bf9829ec3b00240707ff4ba04b1a1265317 (diff) |
Clear any categories from user when unsetting from_body
This was most likely the cause of #2815.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin/Users.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Users.pm b/perllib/FixMyStreet/App/Controller/Admin/Users.pm index 1520fe990..046e19126 100644 --- a/perllib/FixMyStreet/App/Controller/Admin/Users.pm +++ b/perllib/FixMyStreet/App/Controller/Admin/Users.pm @@ -373,6 +373,8 @@ sub edit : Chained('user') : PathPart('') : Args(0) { my @live_contact_ids = map { $_->id } @live_contacts; my @new_contact_ids = grep { $c->get_param("contacts[$_]") } @live_contact_ids; $user->set_extra_metadata('categories', \@new_contact_ids); + } else { + $user->unset_extra_metadata('categories'); } $user->update; |