From 80e17f5f9e9fbfec811a82e0a9631ad71617c80b Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Fri, 28 Aug 2020 12:35:35 +1000 Subject: [PATCH] DEV: Remove staff bypass on fix missing After thinking about it, I worry that this will potentially leave a site setting set when people hit ctrl-c ... feels a tiny bit risky, so leaving it out. --- lib/tasks/uploads.rake | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake index 013f9a9e9a1..89e3892875f 100644 --- a/lib/tasks/uploads.rake +++ b/lib/tasks/uploads.rake @@ -1181,20 +1181,12 @@ def fix_missing_s3 puts end -def allow_all_uploads - old_staff_extension = SiteSetting.authorized_extensions_for_staff - SiteSetting.authorized_extensions_for_staff = "*" - yield -ensure - SiteSetting.authorized_extensions_for_staff = old_staff_extension -end - task "uploads:fix_missing_s3" => :environment do if RailsMultisite::ConnectionManagement.current_db != "default" - allow_all_uploads { fix_missing_s3 } + fix_missing_s3 else RailsMultisite::ConnectionManagement.each_connection do - allow_all_uploads { fix_missing_s3 } + fix_missing_s3 end end end