aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorlizconlan <liz@mysociety.org>2014-06-25 14:44:02 +0100
committerlizconlan <liz@mysociety.org>2014-07-28 11:47:32 +0100
commit330046dee98a9cb5ee84dd9512b247a685ac6914 (patch)
tree5c303bfc7de47e9011fc1a4b23eca8dbddf09c90 /app/models/info_request.rb
parentf3abf87add310d8b446472da2a31eeb05feb31b8 (diff)
Refactor state update API, better error handling
Filters; more 403s, fewer 500s; added logging; less duplication
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index a2112a210..aed651ad3 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -115,6 +115,16 @@ class InfoRequest < ActiveRecord::Base
states
end
+ # Subset of states accepted via the API
+ def self.allowed_incoming_states
+ [
+ 'waiting_response',
+ 'rejected',
+ 'successful',
+ 'partially_successful'
+ ]
+ end
+
# Possible reasons that a request could be reported for administrator attention
def report_reasons
[_("Contains defamatory material"),