aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 97181ddf7..1d6189915 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: request_controller.rb,v 1.161 2009-06-15 14:42:11 francis Exp $
+# $Id: request_controller.rb,v 1.162 2009-06-16 17:28:16 francis Exp $
class RequestController < ApplicationController
@@ -433,6 +433,13 @@ class RequestController < ApplicationController
raise sprintf("Incoming message %d does not belong to request %d", @incoming_message.info_request_id, @info_request.id)
end
+ if !RequestMailer.is_followupable?(@info_request, @incoming_message)
+ raise "unexpected followupable inconsistency" if @info_request.public_body.is_requestable?
+ @reason = @info_request.public_body.not_requestable_reason
+ render :action => 'followup_bad'
+ return
+ end
+
# Force login early - this is really the "send followup" form. We want
# to make sure they're the right user first, before they start writing a
# message and wasting their time if they are not the requester.