lib/flapjack/gateways/api/contact_methods.rb in flapjack-0.9.3 vs lib/flapjack/gateways/api/contact_methods.rb in flapjack-0.9.4
- old
+ new
@@ -163,10 +163,12 @@
logger.debug("put /notification_rules/#{params[:id]} data: ")
logger.debug(params.inspect)
rule = find_rule(params[:id])
- contact = find_contact(rule.contact_id)
+
+ # previous bug may have led to rule's contact_id being wiped :(
+ contact = find_contact(rule.contact_id || params[:contact_id])
rule_data = hashify(:entities, :regex_entities, :tags, :regex_tags,
:unknown_media, :warning_media, :critical_media, :time_restrictions,
:unknown_blackhole, :warning_blackhole, :critical_blackhole) {|k| [k, params[k]]}