diff --git a/docs/Installing.asciidoc b/docs/Installing.asciidoc index f09bc243776..e2c13b9716e 100644 --- a/docs/Installing.asciidoc +++ b/docs/Installing.asciidoc @@ -333,7 +333,7 @@ Jobs: Tables: table_create table_update table_delete Users: - user_comment user_login + user_new_comment user_update_comment user_delete_comment user_login Needles: needle_delete needle_modify ---- diff --git a/lib/OpenQA/WebAPI/Controller/API/V1/Comment.pm b/lib/OpenQA/WebAPI/Controller/API/V1/Comment.pm index 138d26f0cc1..ee5a1f58b7f 100644 --- a/lib/OpenQA/WebAPI/Controller/API/V1/Comment.pm +++ b/lib/OpenQA/WebAPI/Controller/API/V1/Comment.pm @@ -62,7 +62,6 @@ sub text { # Adds a new comment to the specified job/group. sub create { my ($self) = @_; - $self->app->log->debug('create comment'); my $comments = $self->comments(); return unless $comments; @@ -74,7 +73,7 @@ sub create { text => $text, user_id => $self->current_user->id }); - $self->emit_event('openqa_user_comment', {id => $res->id}); + $self->emit_event('openqa_user_new_comment', {id => $res->id}); $self->render(json => {id => $res->id}); } @@ -92,7 +91,7 @@ sub update { return $self->render(json => {error => "Comment $comment_id does not exist"}, status => 404) unless $comment; return $self->render(json => {error => "Forbidden (must be author)"}, status => 403) unless ($comment->user_id == $self->current_user->id); my $res = $comment->update({text => $text}); - $self->emit_event('openqa_user_comment', {id => $comment->id}); + $self->emit_event('openqa_user_update_comment', {id => $comment->id}); $self->render(json => {id => $res->id}); } @@ -106,7 +105,7 @@ sub delete { my $comment = $comments->find($self->param('comment_id')); return $self->render(json => {error => "Comment $comment_id does not exist"}, status => 404) unless $comment; my $res = $comment->delete(); - $self->emit_event('openqa_user_comment', {id => $res->id}); + $self->emit_event('openqa_user_delete_comment', {id => $res->id}); $self->render(json => {id => $res->id}); } diff --git a/lib/OpenQA/WebAPI/Plugin/AuditLog.pm b/lib/OpenQA/WebAPI/Plugin/AuditLog.pm index c5529dab6ed..53614365043 100644 --- a/lib/OpenQA/WebAPI/Plugin/AuditLog.pm +++ b/lib/OpenQA/WebAPI/Plugin/AuditLog.pm @@ -26,7 +26,7 @@ my @table_events = qw/table_create table_update table_delete/; my @job_events = qw/job_create job_delete job_cancel job_duplicate job_restart jobs_restart job_update_result job_set_waiting job_set_running job_done job_grab job_cancel_by_settings/; my @jobgroup_events = qw/jobgroup_create jobgroup_connect/; my @jobtemplate_events = qw/jobtemplate_create jobtemplate_delete/; -my @user_events = qw/user_update user_login user_comment/; +my @user_events = qw/user_update user_login user_new_comment user_update_comment user_delete_comment/; my @asset_events = qw/asset_register asset_delete/; my @iso_events = qw/iso_create iso_delete iso_cancel/; my @worker_events = qw/command_enqueue worker_register/;