diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-04-30 13:56:31 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-05-06 16:09:29 +0100 |
commit | 730d25ae7218d731590b322d4f419a7df6d4e4fb (patch) | |
tree | 17a609759d5fb9ee49e216d485949cd94aa86845 /perllib/FixMyStreet/App/Controller | |
parent | 683b188b288fe43526e1649c784fa44435559655 (diff) |
Add ability to disallow updates in a category.
Add a tickbox to the category admin, and do not allow updates on
reports made in those selected categories.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin/Bodies.pm | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm index 6ae068cd9..61b486f02 100644 --- a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm +++ b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm @@ -267,15 +267,12 @@ sub update_contact : Private { $contact->send_method( $c->get_param('send_method') ); # Set flags in extra to the appropriate values - if ( $c->get_param('photo_required') ) { - $contact->set_extra_metadata_if_undefined( photo_required => 1 ); - } else { - $contact->unset_extra_metadata( 'photo_required' ); - } - if ( $c->get_param('open311_protect') ) { - $contact->set_extra_metadata( open311_protect => 1 ); - } else { - $contact->unset_extra_metadata( 'open311_protect' ); + foreach (qw(photo_required open311_protect updates_disallowed)) { + if ( $c->get_param($_) ) { + $contact->set_extra_metadata( $_ => 1 ); + } else { + $contact->unset_extra_metadata($_); + } } if ( my @group = $c->get_param_list('group') ) { @group = grep { $_ } @group; |