aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2012-10-09 16:23:51 +1100
committerMatthew Landauer <matthew@openaustralia.org>2012-10-09 16:23:51 +1100
commitd23ea224d976115f6a1e83d34c878b4a0e42c924 (patch)
treec0314600a3e5320edbeac93870c8c9b35d24be69
parentf27413e8fa2ca61ef531bbb45543f2b8b9a0e457 (diff)
Send a warning to stdout when trying to load logs for non-existent info requests
-rw-r--r--app/models/exim_log.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/exim_log.rb b/app/models/exim_log.rb
index e1861150f..6d508b7a6 100644
--- a/app/models/exim_log.rb
+++ b/app/models/exim_log.rb
@@ -67,13 +67,15 @@ class EximLog < ActiveRecord::Base
emails = line.scan(/request-[^\s]+@#{email_domain}/).sort.uniq
for email in emails
info_request = InfoRequest.find_by_incoming_email(email)
- if !info_request.nil?
+ if info_request
exim_log = EximLog.new
exim_log.info_request = info_request
exim_log.exim_log_done = done
exim_log.line = line
exim_log.order = order
exim_log.save!
+ else
+ puts "Warning: Could not find request with email #{email}"
end
end
end