diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-08-19 14:11:52 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-08-19 14:11:52 +0100 |
commit | 638a0cb31b5dd3c0131035c19c14e0ac709a9a2e (patch) | |
tree | 601104ed74c1bf8d9df6c8f629b8695f778fbf9d /lib/mauve/web_interface.rb | |
parent | cdd1b094b27960595a8750247c5b2f2576cd5872 (diff) |
Added note-ability (fixes 1146)
Removed threaded notifications cos we don't need em. (ftw!)
Diffstat (limited to 'lib/mauve/web_interface.rb')
-rw-r--r-- | lib/mauve/web_interface.rb | 12 |
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 |