Skip to content

A platform for community discussion. Free, open, simple.

FIX: `uploads:fix_missing_s3` rake task used wrong SHA1 (#12495)

Gerhard Schlageracc73f298988
diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake
index d2ab4e82c8d..8d183a58a5f 100644
--- a/lib/tasks/uploads.rake
+++ b/lib/tasks/uploads.rake
@@ -1023,7 +1023,7 @@ def fix_missing_s3
fix_error = nil
Upload.transaction do
begin
- upload.update!(sha1: SecureRandom.hex)
+ upload.update_column(:sha1, SecureRandom.hex)
fixed_upload = UploadCreator.new(tempfile, "temp.#{upload.extension}").create_for(Discourse.system_user.id)
rescue => fix_error
# invalid extension is the most common issue