diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-11-10 19:27:06 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-11-10 19:27:06 +0000 |
commit | d8dd060a4c2f75e89a24f99634d91a6d8ef0e2bc (patch) | |
tree | abb543c32c9e5f239cc66cff1bafa697f322ebd3 /perllib/FixMyStreet/App/Controller/Admin/Roles.pm | |
parent | db61249c59a96a2fad80523288b7d13881c10965 (diff) | |
parent | b886792181eb77206054e73315a9d14cdb17e936 (diff) |
Merge branch 'admin-auditing'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin/Roles.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin/Roles.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Roles.pm b/perllib/FixMyStreet/App/Controller/Admin/Roles.pm index 902ed6255..279ee695c 100644 --- a/perllib/FixMyStreet/App/Controller/Admin/Roles.pm +++ b/perllib/FixMyStreet/App/Controller/Admin/Roles.pm @@ -63,6 +63,7 @@ sub form { if ($c->get_param('delete_role')) { $role->delete; + $c->forward('/admin/log_edit', [ $role->id, 'role', 'delete' ]); $c->response->redirect($c->uri_for($self->action_for('index'))); $c->detach; } @@ -88,11 +89,13 @@ sub form { $opts->{body_id} = $c->user->from_body->id; } + my $action = $role->in_storage ? 'edit' : 'add'; my $form = FixMyStreet::App::Form::Role->new(%$opts); $c->stash(template => 'admin/roles/form.html', form => $form); $form->process(item => $role, params => $c->req->params); return unless $form->validated; + $c->forward('/admin/log_edit', [ $role->id, 'role', $action ]); $c->response->redirect($c->uri_for($self->action_for('index'))); } |