diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/request_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/user_controller.rb | 3 | ||||
-rw-r--r-- | app/views/request/list.rhtml | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 11812b729..75bdac2a9 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -168,7 +168,8 @@ class RequestController < ApplicationController query = make_query_from_params @title = _("View and search requests") sortby = "newest" - behavior_cache :tag => [@query, @page, I18n.locale] do + @cache_tag = Digest::MD5.hexdigest(query + @page.to_s) + behavior_cache :tag => [@cache_tag] do xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_collapse') @list_results = xapian_object.results.map { |r| r[:model] } @matches_estimated = xapian_object.matches_estimated @@ -696,7 +697,8 @@ class RequestController < ApplicationController @incoming_message.parse_raw_email! @info_request = @incoming_message.info_request if @incoming_message.info_request_id != params[:id].to_i - raise ActiveRecord::RecordNotFound.new(sprintf("Incoming message %d does not belong to request %d", @incoming_message.info_request_id, params[:id])) + message = "Incoming message %d does not belong to request %d" % [@incoming_message.info_request_id, params[:id]] + raise ActiveRecord::RecordNotFound.new(message) end @part_number = params[:part].to_i @filename = params[:file_name].join("/") diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 45b71a3a9..f49fc9165 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -489,7 +489,8 @@ class UserController < ApplicationController raise ActiveRecord::RecordNotFound.new("user not found, url_name=" + params[:url_name]) end if !@display_user.profile_photo - raise "user has no profile photo, url_name=" + params[:url_name] + raise ActiveRecord::RecordNotFound.new("user has no profile photo, url_name=" + params[:url_name]) + end response.content_type = "image/png" diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml index 42cd41498..7cbd982f1 100644 --- a/app/views/request/list.rhtml +++ b/app/views/request/list.rhtml @@ -14,7 +14,7 @@ <div style="clear:both"></div> <div class="results_section"> - <% view_cache :ttl => 5.minutes.to_i, :tag => [@query, @page, I18n.locale] do %> + <% view_cache :ttl => 5.minutes.to_i, :tag => [@cache_tag] do %> <% if @list_results.empty? %> <p> <%= _('No requests of this sort yet.')%></p> <% else %> |