mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 21:12:02 +08:00
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.
This commit is contained in:
parent
ed9323043f
commit
80e17f5f9e
@ -1181,20 +1181,12 @@ def fix_missing_s3
|
|||||||
puts
|
puts
|
||||||
end
|
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
|
task "uploads:fix_missing_s3" => :environment do
|
||||||
if RailsMultisite::ConnectionManagement.current_db != "default"
|
if RailsMultisite::ConnectionManagement.current_db != "default"
|
||||||
allow_all_uploads { fix_missing_s3 }
|
fix_missing_s3
|
||||||
else
|
else
|
||||||
RailsMultisite::ConnectionManagement.each_connection do
|
RailsMultisite::ConnectionManagement.each_connection do
|
||||||
allow_all_uploads { fix_missing_s3 }
|
fix_missing_s3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user