From f560987ab0d3ea3471837a2b30d30c7101dc5616 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Tue, 12 Jun 2012 09:55:16 +0100 Subject: Make emails requesting admin attention appear to come from the user who requested the attention, not the user who made the original request. --- app/controllers/request_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index bd2bfc974..f87efbcb0 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -663,7 +663,7 @@ class RequestController < ApplicationController ) if !info_request.attention_requested - info_request.set_described_state('attention_requested') + info_request.set_described_state('attention_requested', @user) info_request.attention_requested = true # tells us if attention has ever been requested info_request.save! flash[:notice] = _("This request has been reported for administrator attention") -- cgit v1.2.3 From 4bb3e9d5ff49ec5fb108a5a618993248abcb3692 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Fri, 15 Jun 2012 13:28:07 +0100 Subject: Revert "Set a "Content-Disposition: attachment" header when downloading files. Closes #428" This reverts commit 506af7a640f63b17000ccfc5e1344bbc3039c913. See issue #428 for a discussion --- app/controllers/request_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index f87efbcb0..aa770e151 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # app/controllers/request_controller.rb: # Show information about one particular request. # @@ -710,7 +709,7 @@ class RequestController < ApplicationController # we don't use @attachment.content_type here, as we want same mime type when cached in cache_attachments above response.content_type = AlaveteliFileTypes.filename_to_mimetype(params[:file_name].join("/")) || 'application/octet-stream' - headers["Content-Disposition"] = "attachment; filename=#{params[:file_name]}" + render :text => @attachment.body end -- cgit v1.2.3 From 76839f2090b7f1ca943439ddd794728518eda46a Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 20 Jun 2012 09:46:03 +0100 Subject: Increase the time a page is cached for sites that are using Varnish. Relatedly, document the consequences of getting the Varnish config wrong; and make it easier to grep for problems with Varnish in the log. --- app/controllers/request_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index aa770e151..89d49ba57 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -46,7 +46,7 @@ class RequestController < ApplicationController end def show - medium_cache + long_cache @locale = self.locale_from_params() PublicBody.with_locale(@locale) do -- cgit v1.2.3 From c100cb5aff5a958709aae77d03e6a4aea666a910 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 20 Jun 2012 09:47:14 +0100 Subject: Only extend the cache time on InfoRequest views for sites with Varnish purging set up --- app/controllers/request_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 89d49ba57..2f5b4d643 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -46,7 +46,13 @@ class RequestController < ApplicationController end def show - long_cache + if !MySociety::Config.get('VARNISH_HOST').nil? + # If varnish is set up to accept PURGEs, then cache for a + # long time + long_cache + else + medium_cache + end @locale = self.locale_from_params() PublicBody.with_locale(@locale) do -- cgit v1.2.3