aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/web_interface.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mauve/web_interface.rb')
-rw-r--r--lib/mauve/web_interface.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/mauve/web_interface.rb b/lib/mauve/web_interface.rb
index bf2c667..82dc654 100644
--- a/lib/mauve/web_interface.rb
+++ b/lib/mauve/web_interface.rb
@@ -220,11 +220,6 @@ EOF
begin
a.acknowledge!(@person, ack_until)
- logger.debug note
- unless note.to_s.empty?
- h = History.new(:alerts => [a], :type => "note", :event => note.to_s)
- logger.debug h.errors unless h.save
- end
succeeded << a
rescue StandardError => ex
logger.error "Caught #{ex.to_s} when trying to save #{a.inspect}"
@@ -232,6 +227,13 @@ EOF
failed << ex
end
end
+ #
+ # Add a note
+ #
+ unless note.to_s.empty?
+ h = History.new(:alerts => succeeded, :type => "note", :event => session['username']+" noted "+note.to_s)
+ logger.debug h.errors unless h.save
+ end
flash["error"] = "Failed to acknowledge #{failed.length} alerts." if failed.length > 0
flash["notice"] = "Successfully acknowledged #{succeeded.length} alerts" if succeeded.length > 0