aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorfrancis <francis>2009-02-27 22:32:13 +0000
committerfrancis <francis>2009-02-27 22:32:13 +0000
commit77344d35a51efb1673829d1c30477bbf6c6ae9d6 (patch)
tree47bd5fa54b78a09913a3fa9c35b314ca5c9d9353 /app/models/info_request.rb
parent5161e6b3d05e5d7879583439d6eca1a9b36d357a (diff)
Change it to ask "what best describes the status of this request now"
rather than "what *is* the status..." Remove "none of the above" for now, see how that goes. Add new error_message state, for delivery failures etc.
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index d30967b1c..f7579c6d8 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.165 2009-02-27 16:50:53 francis Exp $
+# $Id: info_request.rb,v 1.166 2009-02-27 22:32:13 francis Exp $
require 'digest/sha1'
require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian')
@@ -59,6 +59,7 @@ class InfoRequest < ActiveRecord::Base
'successful',
'partially_successful',
'internal_review',
+ 'error_message',
'requires_admin',
'user_withdrawn'
]
@@ -323,6 +324,12 @@ public
return ir
end
+ # states which require administrator action (hence email administrators
+ # when they are entered, and offer state change dialog to them)
+ def self.requires_admin_states
+ return ['requires_admin', 'error_message']
+ end
+
# change status, including for last event for later historical purposes
def set_described_state(new_state)
ActiveRecord::Base.transaction do
@@ -336,7 +343,7 @@ public
self.calculate_event_states
- if new_state == 'requires_admin'
+ if InfoRequest.requires_admin_states.include?(new_state)
RequestMailer.deliver_requires_admin(self)
end
end
@@ -656,6 +663,8 @@ public
"Handled by post."
elsif status == 'internal_review'
"Awaiting internal review."
+ elsif status == 'error_message'
+ "Delivery error"
elsif status == 'requires_admin'
"Unusual response."
elsif status == 'user_withdrawn'