From 6f66fe8a30083a2fa49618b4dad828c0cef3b310 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Mon, 20 Aug 2012 07:16:55 +0100 Subject: External requests ought not to be considered old_unclassified We certainly do not want to send reminder emails for such requests, for example, since we do not know the email address to send them to. --- app/models/info_request.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 2f4a89d91..6426f6ea8 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -942,7 +942,7 @@ public last_response_created_at = last_event_time_clause('response') age = extra_params[:age_in_days] ? extra_params[:age_in_days].days : OLD_AGE_IN_DAYS params = {:select => "*, #{last_response_created_at} as last_response_time", - :conditions => ["awaiting_description = ? and #{last_response_created_at} < ? and url_title != 'holding_pen'", + :conditions => ["awaiting_description = ? and #{last_response_created_at} < ? and url_title != 'holding_pen' and user_id is not null", true, Time.now() - age], :order => "last_response_time"} params[:limit] = extra_params[:limit] if extra_params[:limit] @@ -960,6 +960,7 @@ public end def is_old_unclassified? + return false if user_id.nil? return false if !awaiting_description return false if url_title == 'holding_pen' last_response_event = get_last_response_event -- cgit v1.2.3