aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-10-24 12:04:49 +0100
committerLouise Crow <louise.crow@gmail.com>2013-12-04 09:32:41 +0000
commit857128b465cf345756bbeabbccdc673921090210 (patch)
treed4c140106e540f4bdf4bcbe4f00c20318f52bc2c /app/controllers/request_controller.rb
parent539041a4404cb918b5d87ce3b858a20fba09f35a (diff)
Remove extra 'is invalid' error message.
This duplicates what's done in the new action, but I can't currently think of a way of sharing functionality that doesn't seem overly complex and/or risky.
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index e249bbe5c..821fcb74a 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -216,8 +216,10 @@ class RequestController < ApplicationController
@outgoing_message.info_request = @info_request
@info_request.user = authenticated_user
if !@info_request.valid?
- # TODO: add in code from 'new' for removing spurious extra
- # "Outgoing messages is invalid" message - move to model?
+ # We don't want the error "Outgoing messages is invalid", as in this
+ # case the list of errors will also contain a more specific error
+ # describing the reason it is invalid.
+ @info_request.errors.delete(:outgoing_messages)
render :action => 'new'
return
end