aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/admin_request_controller.rb12
-rw-r--r--app/models/incoming_message.rb7
-rw-r--r--app/models/info_request_event.rb3
-rw-r--r--app/views/admin/timeline.rhtml2
-rw-r--r--todo.txt4
5 files changed, 18 insertions, 10 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb
index fa689035b..646aaacc1 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_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: admin_request_controller.rb,v 1.20 2008-09-22 22:25:37 francis Exp $
+# $Id: admin_request_controller.rb,v 1.21 2008-09-23 21:00:13 francis Exp $
class AdminRequestController < ApplicationController
layout "admin"
@@ -126,13 +126,11 @@ class AdminRequestController < ApplicationController
def destroy_incoming
@incoming_message = IncomingMessage.find(params[:incoming_message_id])
@info_request = @incoming_message.info_request
-
- deleted_incoming_message = @incoming_message
incoming_message_id = @incoming_message.id
@incoming_message.fully_destroy
@incoming_message.info_request.log_event("destroy_incoming",
- { :editor => admin_http_auth_user(), :deleted_incoming_message => deleted_incoming_message })
+ { :editor => admin_http_auth_user(), :deleted_incoming_message_id => incoming_message_id })
flash[:notice] = 'Incoming message successfully destroyed.'
redirect_to request_admin_url(@info_request)
@@ -157,7 +155,13 @@ class AdminRequestController < ApplicationController
mail.base64_decode
destination_request.receive(mail, raw_email_data)
+ incoming_message_id = incoming_message.id
incoming_message.fully_destroy
+ incoming_message.info_request.log_event("redeliver_incoming", {
+ :editor => admin_http_auth_user(),
+ :destination_request => destination_request.id,
+ :deleted_incoming_message_id => incoming_message_id
+ })
flash[:notice] = "Message has been moved to this request"
redirect_to request_admin_url(destination_request)
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 59e2ec9a7..6a999b61d 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -19,7 +19,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: incoming_message.rb,v 1.149 2008-09-22 22:16:37 francis Exp $
+# $Id: incoming_message.rb,v 1.150 2008-09-23 21:00:14 francis Exp $
# TODO
# Move some of the (e.g. quoting) functions here into rblib, as they feel
@@ -845,10 +845,9 @@ class IncomingMessage < ActiveRecord::Base
info_request_event.track_things_sent_emails.each { |a| a.destroy }
info_request_event.user_info_request_sent_alerts.each { |a| a.destroy }
info_request_event.destroy
- if !self.raw_email.nil?
- self.raw_email.destroy
- end
+ raw_email = self.raw_email
self.destroy
+ self.raw_email.destroy
end
end
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index f99bfdcf4..7b32954d3 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -21,7 +21,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: info_request_event.rb,v 1.60 2008-09-22 22:16:37 francis Exp $
+# $Id: info_request_event.rb,v 1.61 2008-09-23 21:00:14 francis Exp $
class InfoRequestEvent < ActiveRecord::Base
belongs_to :info_request
@@ -44,6 +44,7 @@ class InfoRequestEvent < ActiveRecord::Base
'edit_outgoing', # outgoing message edited in admin interface
'edit_comment', # comment edited in admin interface
'destroy_incoming', # deleted an incoming message
+ 'redeliver_incoming', # redelivered an incoming message elsewhere
'manual', # you did something in the db by hand
'response',
'comment'
diff --git a/app/views/admin/timeline.rhtml b/app/views/admin/timeline.rhtml
index 4c4aa4f36..25e871232 100644
--- a/app/views/admin/timeline.rhtml
+++ b/app/views/admin/timeline.rhtml
@@ -62,6 +62,8 @@
<% end %>
<% elsif event.event_type == 'destroy_incoming' %>
had incoming message deleted by administrator <strong><%=h event.params[:editor] %></strong>.
+ <% elsif event.event_type == 'redeliver_incoming' %>
+ had incoming message redelivered to another request by administrator <strong><%=h event.params[:editor] %></strong>.
<% elsif event.event_type == 'response' %>
<% incoming_message = event.incoming_message %>
received
diff --git a/todo.txt b/todo.txt
index 8a8124ab1..6888917eb 100644
--- a/todo.txt
+++ b/todo.txt
@@ -6,7 +6,9 @@ Next
This doesn't work:
http://www.whatdotheyknow.com/search/status:waiting_classification/
-Optimise so doesn't load raw_data in on every page
+Performance:
+ Remove loading of public body tags from every info request load
+
Upload Julian's large Cambridgeshire contract
Sort admin tag search by name rather than by modification date