diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-19 14:36:06 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-19 14:36:06 +0000 |
commit | f4e16a6a5fd363c145a26e91bdf8d87821772f80 (patch) | |
tree | 90a082067f7705d8ad0b5dafba503be85c1716d4 /app/controllers/request_controller.rb | |
parent | 63c5ed67bf023852b121993d0fc7ce62e0be1023 (diff) | |
parent | b2618cc78e86176c13e2b4197d56270242680884 (diff) |
Merge branch 'wdtk' of github.com:sebbacon/alaveteli into wdtk
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r-- | app/controllers/request_controller.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 1c7aeedcc..aeb6d31fe 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -155,6 +155,13 @@ class RequestController < ApplicationController if @view == "recent" return redirect_to request_list_all_path(:action => "list", :view => "all", :page => @page), :status => :moved_permanently end + + # Temporary patch + # Later pages are very expensive to load + if @page > 100 + raise "Sorry. No pages after 100 today." + end + params[:latest_status] = @view query = make_query_from_params @title = _("View and search requests") @@ -682,10 +689,11 @@ class RequestController < ApplicationController # Internal function def get_attachment_internal(html_conversion) @incoming_message = IncomingMessage.find(params[:incoming_message_id]) + @requested_request = InfoRequest.find(params[:id]) @incoming_message.parse_raw_email! @info_request = @incoming_message.info_request if @incoming_message.info_request_id != params[:id].to_i - raise sprintf("Incoming message %d does not belong to request %d", @incoming_message.info_request_id, params[:id]) + raise ActiveRecord::RecordNotFound.new("Incoming message %d does not belong to request %d", @incoming_message.info_request_id, params[:id]) end @part_number = params[:part].to_i @filename = params[:file_name].join("/") |