diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-18 18:14:38 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-18 18:14:38 +0100 |
commit | de83746b5a33f1d2ac573f67c94760cb0a67b57e (patch) | |
tree | 15bba173841054b11fd3ab0515f9ea60c0850b0f /lib/mauve/web_interface.rb | |
parent | 9e3d08a472053ddcd16ab69ad057b9e59194f9af (diff) |
* Don't send acknowledged notifications unless the alert is raised
* Unacknowledge a cleared alert or a newly raised one
* Fixed interface unexpected nil errors.
Diffstat (limited to 'lib/mauve/web_interface.rb')
-rw-r--r-- | lib/mauve/web_interface.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mauve/web_interface.rb b/lib/mauve/web_interface.rb index de12291..29e41f7 100644 --- a/lib/mauve/web_interface.rb +++ b/lib/mauve/web_interface.rb @@ -186,10 +186,10 @@ EOF type_hours = params[:type_hours] || "daylight" alerts = params[:alerts] || [] - n_hours = (n_hours > 188 ? 188 : n_hours) + n_hours = (n_hours.to_i > 188 ? 188 : n_hours.to_i) if ack_until.to_s.empty? - ack_until = Time.now.in_x_hours(n_hours.to_i, type_hours.to_s) + ack_until = Time.now.in_x_hours(n_hours, type_hours.to_s) else ack_until = Time.at(ack_until.to_i) end |