aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/request_controller.rb14
-rw-r--r--todo.txt16
2 files changed, 13 insertions, 17 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 40eb48ccb..e317b5f48 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.39 2008-01-18 03:30:21 francis Exp $
+# $Id: request_controller.rb,v 1.40 2008-01-22 13:48:16 francis Exp $
class RequestController < ApplicationController
@@ -65,6 +65,7 @@ class RequestController < ApplicationController
@info_request.user = authenticated_user
# This automatically saves dependent objects, such as @outgoing_message, in the same transaction
@info_request.save!
+ # XXX send_message needs the database id, so we send after saving, which isn't ideal if the request broke here.
@outgoing_message.send_message
flash[:notice] = "Your Freedom of Information request has been created and sent on its way."
redirect_to show_request_url(:id => @info_request)
@@ -120,21 +121,18 @@ class RequestController < ApplicationController
redirect_to show_request_url(:id => @info_request)
return
elsif !params[:submitted_followup].nil?
- # Send a follow up message
- @info_request.outgoing_messages << @outgoing_message
- @outgoing_message.info_request = @info_request
-
# See if values were valid or not
- if !@info_request.valid?
+ @outgoing_message.info_request = @info_request
+ if !@outgoing_message.valid?
render :action => 'show_response'
elsif authenticated_as_user?(@info_request.user,
:web => "To send a follow up message about your FOI request",
:email => "Then you can send a follow up message to " + @info_request.public_body.name + ".",
:email_subject => "Confirm your FOI follow up message to " + @info_request.public_body.name
)
- # This automatically saves dependent objects, such as @outgoing_message, in the same transaction
- @info_request.save!
+ # Send a follow up message
@outgoing_message.send_message
+ @outgoing_message.save!
flash[:notice] = "Your follow up message has been created and sent on its way."
redirect_to show_request_url(:id => @info_request)
else
diff --git a/todo.txt b/todo.txt
index 5ad645332..073e3ea2a 100644
--- a/todo.txt
+++ b/todo.txt
@@ -72,18 +72,9 @@ Followups:
- don't show classify link on /response/ page
Alert somewhere if working days table not up to date
-Test it works if exim is down - e.g. not accepting connections
-
Make it so if the pipe fails, exim tries again rather than sending an error to the public body.
Or so errors go to an admin somehow, at the very least.
-Work out how to get it to tell you code coverage of .rhtml files
-Make it validate the HTML
- maybe with http://www.anodyne.ca/wp-content/uploads/2007/09/be_valid_xhtml.rb
-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
-
Show due date on, e.g.
http://foi.mysociety.org/request/4
Sort by due date, show categorisation everywhere
@@ -99,6 +90,13 @@ sort orders we need)
Tidying
=======
+Work out how to get it to tell you code coverage of .rhtml files
+Make it validate the HTML
+ maybe with http://www.anodyne.ca/wp-content/uploads/2007/09/be_valid_xhtml.rb
+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
+
Add display of users to admin interface (so can find their email address out)
Link internally between different bits of admin interface