aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/person.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mauve/person.rb')
-rw-r--r--lib/mauve/person.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/mauve/person.rb b/lib/mauve/person.rb
index 8ce0952..fd8cf98 100644
--- a/lib/mauve/person.rb
+++ b/lib/mauve/person.rb
@@ -253,10 +253,8 @@ module Mauve
#
# Log the result
- note = "#{@alert.update_type.capitalize} #{name} notification to #{@person.username} (#{destination}) " + (res ? "succeeded" : "failed" )
- logger.info note+" about #{@alert}."
- h = History.new(:alerts => [@alert], :type => "notification", :event => note, :user => @person.username)
- h.save
+ #
+ logger.info "#{@alert.update_type.capitalize} #{name} notification to #{@person.username} (#{destination}) " + (res ? "succeeded" : "failed" ) +" about #{@alert}."
return res
end
@@ -282,7 +280,7 @@ module Mauve
# and are still suppressed.
#
if @suppressed or self.is_on_holiday?(now) or self.is_off_sick?(now)
- note = "#{alert.update_type.capitalize} notification to #{self.username} suppressed"
+ note = "#{alert.update_type.capitalize} #{level} notification to #{self.username} suppressed"
logger.info note + " about #{alert}."
History.create(:alerts => [alert], :type => "notification", :event => note, :user => self.username)
return true
@@ -303,8 +301,13 @@ module Mauve
:was_suppressed => was_suppressed, }
).instance_eval(&__send__(level))
end
+
+ res = [result].flatten.any?
+
+ note = "#{alert.update_type.capitalize} #{level} notification to #{self.username} " + (res ? "succeeded" : "failed" )
+ History.create(:alerts => [alert], :type => "notification", :event => note, :user => self.username)
- return [result].flatten.any?
+ return res
end
#