aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-11-05 18:19:46 +0000
committerfrancis <francis>2008-11-05 18:19:46 +0000
commitf1a2a5f272f4bb29cb12f11e709599bd2443b60e (patch)
tree6b051abf0b59ad004eca94b8aa75f53e8d07b5ce /app/models/info_request.rb
parent569ce862d752fb506072d8a54787455ffd76237e (diff)
Lots of the code for internal review state.
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 231f8dc91..2360a5b8b 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -23,7 +23,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: info_request.rb,v 1.150 2008-10-28 13:29:21 francis Exp $
+# $Id: info_request.rb,v 1.151 2008-11-05 18:19:46 francis Exp $
require 'digest/sha1'
require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian')
@@ -55,6 +55,7 @@ class InfoRequest < ActiveRecord::Base
'rejected',
'successful',
'partially_successful',
+ 'internal_review',
'requires_admin'
]
@@ -304,7 +305,8 @@ public
:status => 'ready',
:message_type => 'initial_request',
:body => 'This is the holding pen request. It shows responses that were sent to invalid addresses, and need moving to the correct request by an adminstrator.',
- :last_sent_at => Time.now()
+ :last_sent_at => Time.now(),
+ :what_doing => 'normal_sort'
})
ir.outgoing_messages << om
@@ -386,10 +388,11 @@ public
event.save!
end
curr_state = nil
- elsif !curr_state.nil? && event.event_type == 'followup_sent' && !event.described_state.nil? && event.described_state == 'waiting_response'
- # followups can set the status to waiting response, which we don't
- # want to propogate to the response itself, as that might already be
- # set to waiting_clarification, which we want to know about.
+ elsif !curr_state.nil? && event.event_type == 'followup_sent' && !event.described_state.nil? && (event.described_state == 'waiting_response' || event.described_state == 'internal_review')
+ # followups can set the status to waiting response / internal
+ # review, which we don't want to propogate to the response
+ # itself, as that might already be set to waiting_clarification
+ # / a success status, which we want to know about.
curr_state = nil
end
end
@@ -630,6 +633,8 @@ public
"Waiting clarification."
elsif status == 'gone_postal'
"Handled by post."
+ elsif status == 'internal review'
+ "Awaiting internal review."
elsif status == 'requires_admin'
"Unusual response."
else