aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Houston <robin@lenny.robin>2011-06-21 03:09:42 +0100
committerRobin Houston <robin@lenny.robin>2011-06-21 03:11:35 +0100
commit543ee94019b124387ef775c1312e40730a0d1cdd (patch)
treef058350f01f69dd0695b58a2a0bee061bfde2e0b
parent9e6a39814fc2db20a5b0938a0b623561393ca8f2 (diff)
Get rid of commented-out STDERR.puts messages
-rw-r--r--app/models/exim_log.rb2
-rw-r--r--app/models/info_request.rb1
-rw-r--r--app/models/request_mailer.rb18
-rw-r--r--app/views/track_mailer/event_digest.rhtml2
-rw-r--r--db/migrate/052_include_event_foreign_references.rb1
-rw-r--r--spec/controllers/request_controller_spec.rb4
6 files changed, 0 insertions, 28 deletions
diff --git a/app/models/exim_log.rb b/app/models/exim_log.rb
index 6bdcdf9c2..ab6822ebc 100644
--- a/app/models/exim_log.rb
+++ b/app/models/exim_log.rb
@@ -68,7 +68,6 @@ class EximLog < ActiveRecord::Base
for email in emails
info_request = InfoRequest.find_by_incoming_email(email)
if !info_request.nil?
- #STDERR.puts "adding log for " + info_request.url_title + " from " + file_name + " line " + line
exim_log = EximLog.new
exim_log.info_request = info_request
exim_log.exim_log_done = done
@@ -112,7 +111,6 @@ class EximLog < ActiveRecord::Base
raise "unexpected parsing of exim line"
end
- #STDERR.puts "check_recent_requests_have_been_sent test: " + exim_log.line # debugging
found = true
end
end
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 3441a73f7..cab28b8f1 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -530,7 +530,6 @@ public
if curr_state.nil?
if !event.described_state.nil?
curr_state = event.described_state
- #STDERR.puts "curr_state " + curr_state
end
end
diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb
index 72c382194..e73b153b9 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.rb
@@ -226,7 +226,6 @@ class RequestMailer < ApplicationMailer
# Send email alerts for overdue requests
def self.alert_overdue_requests()
- #STDERR.puts "alert_overdue_requests"
info_requests = InfoRequest.find(:all, :conditions => [ "described_state = 'waiting_response' and awaiting_description = ?", false ], :include => [ :user ] )
for info_request in info_requests
alert_event_id = info_request.last_event_forming_initial_request.id
@@ -244,7 +243,6 @@ class RequestMailer < ApplicationMailer
sent_already = UserInfoRequestSentAlert.find(:first, :conditions => [ "alert_type = ? and user_id = ? and info_request_id = ? and info_request_event_id = ?", alert_type, info_request.user_id, info_request.id, alert_event_id])
if sent_already.nil?
# Alert not yet sent for this user, so send it
- #STDERR.puts "sending overdue alert to info_request " + info_request.id.to_s + " user " + info_request.user_id.to_s + " event " + alert_event_id
store_sent = UserInfoRequestSentAlert.new
store_sent.info_request = info_request
store_sent.user = info_request.user
@@ -262,7 +260,6 @@ class RequestMailer < ApplicationMailer
end
end
store_sent.save!
- #STDERR.puts "sent " + info_request.user.email
end
end
end
@@ -276,7 +273,6 @@ class RequestMailer < ApplicationMailer
self.alert_new_response_reminders_internal(24, 'new_response_reminder_3')
end
def self.alert_new_response_reminders_internal(days_since, type_code)
- #STDERR.puts "alert_new_response_reminders_internal days:" + days_since.to_s + " type: " + type_code
info_requests = InfoRequest.find_old_unclassified(:order => 'info_requests.id',
:include => [:user],
:age_in_days => days_since)
@@ -291,7 +287,6 @@ class RequestMailer < ApplicationMailer
sent_already = UserInfoRequestSentAlert.find(:first, :conditions => [ "alert_type = ? and user_id = ? and info_request_id = ? and info_request_event_id = ?", type_code, info_request.user_id, info_request.id, alert_event_id])
if sent_already.nil?
# Alert not yet sent for this user
- #STDERR.puts "sending " + type_code + " alert to info_request " + info_request.url_title + " user " + info_request.user.url_name + " event " + alert_event_id.to_s
store_sent = UserInfoRequestSentAlert.new
store_sent.info_request = info_request
store_sent.user = info_request.user
@@ -300,7 +295,6 @@ class RequestMailer < ApplicationMailer
# XXX uses same template for reminder 1 and reminder 2 right now.
RequestMailer.deliver_new_response_reminder_alert(info_request, last_response_message)
store_sent.save!
- #STDERR.puts "sent " + info_request.user.email
end
end
end
@@ -308,7 +302,6 @@ class RequestMailer < ApplicationMailer
# Send email alerts for requests which need clarification. Goes out 3 days
# after last update of event.
def self.alert_not_clarified_request()
- #STDERR.puts "alert_not_clarified_request"
info_requests = InfoRequest.find(:all, :conditions => [ "awaiting_description = ? and described_state = 'waiting_clarification' and info_requests.updated_at < ?", false, Time.now() - 3.days ], :include => [ :user ], :order => "info_requests.id" )
for info_request in info_requests
alert_event_id = info_request.get_last_response_event_id
@@ -320,7 +313,6 @@ class RequestMailer < ApplicationMailer
sent_already = UserInfoRequestSentAlert.find(:first, :conditions => [ "alert_type = 'not_clarified_1' and user_id = ? and info_request_id = ? and info_request_event_id = ?", info_request.user_id, info_request.id, alert_event_id])
if sent_already.nil?
# Alert not yet sent for this user
- #STDERR.puts "sending clarification reminder alert to info_request " + info_request.id.to_s + " user " + info_request.user_id.to_s + " event " + alert_event_id.to_s
store_sent = UserInfoRequestSentAlert.new
store_sent.info_request = info_request
store_sent.user = info_request.user
@@ -332,14 +324,12 @@ class RequestMailer < ApplicationMailer
RequestMailer.deliver_not_clarified_alert(info_request, last_response_message)
end
store_sent.save!
- #STDERR.puts "sent " + info_request.user.email
end
end
end
# Send email alert to request submitter for new comments on the request.
def self.alert_comment_on_request()
- #STDERR.puts "alert_comment_on_request"
# We only check comments made in the last month - this means if the
# cron jobs broke for more than a month events would be lost, but no
@@ -355,22 +345,18 @@ class RequestMailer < ApplicationMailer
info_requests = InfoRequest.find(:all, :conditions => [ "(select id from info_request_events where event_type = 'comment' and info_request_events.info_request_id = info_requests.id and created_at > ? limit 1) is not null", Time.now() - 1.month ], :include => [ { :info_request_events => :user_info_request_sent_alerts } ], :order => "info_requests.id, info_request_events.created_at" )
for info_request in info_requests
- #STDERR.puts "considering request " + info_request.id.to_s
# Count number of new comments to alert on
earliest_unalerted_comment_event = nil
last_comment_event = nil
count = 0
for e in info_request.info_request_events.reverse
- #STDERR.puts "event " + e.id.to_s + " type " + e.event_type
# alert on comments, which were not made by the user who originally made the request
if e.event_type == 'comment' && e.comment.user_id != info_request.user_id
last_comment_event = e if last_comment_event.nil?
alerted_for = e.user_info_request_sent_alerts.find(:first, :conditions => [ "alert_type = 'comment_1' and user_id = ?", info_request.user_id])
- #STDERR.puts "is comment by other user, alerted_for " + alerted_for.to_s + " comment user " + e.comment.user_id.to_s + " request user " + info_request.user_id.to_s + " body: " + e.comment.body
if alerted_for.nil?
- # STDERR.puts "nil!"
count = count + 1
earliest_unalerted_comment_event = e
else
@@ -378,7 +364,6 @@ class RequestMailer < ApplicationMailer
end
end
end
- #STDERR.puts "earliest_unalerted_comment_event " + earliest_unalerted_comment_event.to_s
# Alert needs sending if there are new comments
if count > 0
@@ -388,16 +373,13 @@ class RequestMailer < ApplicationMailer
store_sent.alert_type = 'comment_1'
store_sent.info_request_event_id = last_comment_event.id
if count > 1
- #STDERR.puts "sending multiple comment on request alert to info_request " + info_request.id.to_s + " user " + info_request.user_id.to_s + " count " + count.to_s + " earliest " + earliest_unalerted_comment_event.id.to_s
RequestMailer.deliver_comment_on_alert_plural(info_request, count, earliest_unalerted_comment_event.comment)
elsif count == 1
- #STDERR.puts "sending comment on request alert to info_request " + info_request.id.to_s + " user " + info_request.user_id.to_s + " event " + last_comment_event.id.to_s
RequestMailer.deliver_comment_on_alert(info_request, last_comment_event.comment)
else
raise "internal error"
end
store_sent.save!
- #STDERR.puts "sent " + info_request.user.email
end
end
end
diff --git a/app/views/track_mailer/event_digest.rhtml b/app/views/track_mailer/event_digest.rhtml
index e6914c853..45515e25f 100644
--- a/app/views/track_mailer/event_digest.rhtml
+++ b/app/views/track_mailer/event_digest.rhtml
@@ -57,8 +57,6 @@
main_text += "\n"
end
- #STDERR.puts main_text
- #STDERR.puts @unsubscribe_url
%><%=main_text%>Alter your subscription
=======================
diff --git a/db/migrate/052_include_event_foreign_references.rb b/db/migrate/052_include_event_foreign_references.rb
index 6a66379db..5dfcce4a7 100644
--- a/db/migrate/052_include_event_foreign_references.rb
+++ b/db/migrate/052_include_event_foreign_references.rb
@@ -3,7 +3,6 @@ class IncludeEventForeignReferences < ActiveRecord::Migration
add_column :info_request_events, :incoming_message_id, :integer
add_column :info_request_events, :outgoing_message_id, :integer
for event in InfoRequestEvent.find(:all)
- #STDERR.puts "event " + event.id.to_s
incoming_message = event.incoming_message_via_params
if not incoming_message.nil?
event.incoming_message_id = incoming_message.id
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 759ac5ea1..ac44cb905 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -361,7 +361,6 @@ describe RequestController, "when creating a new request" do
deliveries.size.should == 1
mail = deliveries[0]
mail.body.should =~ /This is a silly letter. It is too short to be interesting./
- #STDERR.puts "=====" + mail.body + "======"
response.should redirect_to(:action => 'show', :url_title => ir.url_title)
end
@@ -863,7 +862,6 @@ describe RequestController, "when sending a followup message" do
mail = deliveries[0]
mail.body.should =~ /What a useless response! You suck./
mail.to_addrs.to_s.should == "FOI Person <foiperson@localhost>"
- #STDERR.puts "=====" + mail.body + "======"
response.should redirect_to(:action => 'show', :url_title => info_requests(:fancy_dog_request).url_title)
@@ -1078,7 +1076,6 @@ describe RequestController, "comment alerts" do
# XXX check mail_url here somehow, can't call comment_url like this:
# mail_url.should == comment_url(comments(:silly_comment))
- #STDERR.puts mail.body
# check if we send again, no more go out
deliveries.clear
@@ -1122,7 +1119,6 @@ describe RequestController, "comment alerts" do
# XXX check mail_url here somehow, can't call comment_url like this:
# mail_url.should == comment_url(comments(:silly_comment))
- #STDERR.puts mail.body
end
end