aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/request_controller.rb7
-rw-r--r--config/environment.rb9
-rw-r--r--todo.txt2
3 files changed, 13 insertions, 5 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 21af0d8b0..e665f690a 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.29 2008-01-04 15:27:18 francis Exp $
+# $Id: request_controller.rb,v 1.30 2008-01-04 16:15:40 francis Exp $
class RequestController < ApplicationController
@@ -25,7 +25,7 @@ class RequestController < ApplicationController
# Page new form posts to
def new
- # First time we get to the page, not everything is filled in
+ # First time we get to the page, just display it
if params[:submitted_new_request].nil?
# Read parameters in - public body can be passed from front page
@info_request = InfoRequest.new(params[:info_request])
@@ -52,6 +52,9 @@ class RequestController < ApplicationController
# See if values were valid or not
if !@existing_request.nil? || !@info_request.valid?
+ # We don't want the error "Outgoing messages is invalid", as the outgoing message
+ # will be valid for a specific reason which we are displaying anyway.
+ @info_request.errors.delete("outgoing_messages")
render :action => 'new'
elsif authenticated?(
:web => "To send your FOI request",
diff --git a/config/environment.rb b/config/environment.rb
index 8c1d4387b..426625102 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -120,5 +120,12 @@ module ActionMailer
end
end
-
+# Monkeypatch! Remove individual error messages from an ActiveRecord.
+module ActiveRecord
+ class Errors
+ def delete(key)
+ @errors.delete(key)
+ end
+ end
+end
diff --git a/todo.txt b/todo.txt
index 025622ac5..cf8ba7323 100644
--- a/todo.txt
+++ b/todo.txt
@@ -36,8 +36,6 @@ Test that it is actually sending the request outgoing mail, by using deliveries
Add fixtures for info_request_event
Test sending a message to bounce/envelope-from address
-Remove "Outgoing messages is invalid" error
-
Tidying
=======