diff options
author | francis <francis> | 2009-06-23 13:52:22 +0000 |
---|---|---|
committer | francis <francis> | 2009-06-23 13:52:22 +0000 |
commit | b7ea98505a332cbc87b2ce3308ac9128785ad7a3 (patch) | |
tree | 4a0b94ab5fcfd66027f0ab2a75f782489fa1ab6c /app/controllers/admin_controller.rb | |
parent | 05c756a608dd5122641c24424d4e6bbda1923c95 (diff) |
"hidden" option to completely hide requests (from everyone except administrator screens).
Diffstat (limited to 'app/controllers/admin_controller.rb')
-rw-r--r-- | app/controllers/admin_controller.rb | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index b33b6a9fc..5810b4b04 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: admin_controller.rb,v 1.24 2009-01-29 12:23:25 francis Exp $ +# $Id: admin_controller.rb,v 1.25 2009-06-23 13:52:25 francis Exp $ class AdminController < ApplicationController @@ -15,4 +15,25 @@ class AdminController < ApplicationController def local_request? true end + + # Expire cached attachment files for a request + def expire_for_request(info_request) + # So is using latest censor rules + info_request.reload + + # clear out cached entries + for incoming_message in info_request.incoming_messages + for attachment in incoming_message.get_attachments_for_display + expire_page :controller => 'request', :action => "get_attachment", :id => info_request.id, + :incoming_message_id => incoming_message.id, + :part => attachment.url_part_number, :file_name => attachment.display_filename + expire_page :controller => 'request', :action => "get_attachment_as_html", :id => info_request.id, + :incoming_message_id => incoming_message.id, + :part => attachment.url_part_number, :file_name => attachment.display_filename + end + end + end + + end + |