diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-12-18 15:42:53 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-12-18 15:42:53 +0000 |
commit | bbdcb09cb9eeb94e3244a22b1129a1e9521947f4 (patch) | |
tree | 4ad15f4138796087c32957261e8b9e7b6f59887b /app/controllers/admin_info_request_event_controller.rb | |
parent | 5cfcdaac505e60914ee4398cfe431bd5d21b58ed (diff) | |
parent | abdc92fd922dd82da85f7c00bdb50e85ed047714 (diff) |
Merge branch 'restful-admin-routes' into rails-3-develop
Diffstat (limited to 'app/controllers/admin_info_request_event_controller.rb')
-rw-r--r-- | app/controllers/admin_info_request_event_controller.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/controllers/admin_info_request_event_controller.rb b/app/controllers/admin_info_request_event_controller.rb new file mode 100644 index 000000000..17d147582 --- /dev/null +++ b/app/controllers/admin_info_request_event_controller.rb @@ -0,0 +1,24 @@ +# app/controllers/admin_info_request_event_controller.rb: +# Controller for FOI request event manipulation from the admin interface. +# +# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ + +class AdminInfoRequestEventController < AdminController + + # used so due dates get fixed + def update + @info_request_event = InfoRequestEvent.find(params[:id]) + if @info_request_event.event_type != 'response' + raise Exception("can only mark responses as requires clarification") + end + @info_request_event.described_state = 'waiting_clarification' + @info_request_event.calculated_state = 'waiting_clarification' + # TODO: deliberately don't update described_at so doesn't reenter search? + @info_request_event.save! + + flash[:notice] = "Old response marked as having been a clarification" + redirect_to admin_request_url(@info_request_event.info_request) + end + +end |