diff --git a/app/jobs/regular/create_avatar_thumbnails.rb b/app/jobs/regular/create_avatar_thumbnails.rb index 2d704602815..01bb21270be 100644 --- a/app/jobs/regular/create_avatar_thumbnails.rb +++ b/app/jobs/regular/create_avatar_thumbnails.rb @@ -10,7 +10,6 @@ module Jobs raise Discourse::InvalidParameters.new(:upload_id) if upload_id.blank? return unless upload = Upload.find_by(id: upload_id) - return unless user = User.find_by(id: args[:user_id] || upload.user_id) Discourse.avatar_sizes.each do |size| OptimizedImage.create_for( diff --git a/lib/backup_restore/restorer.rb b/lib/backup_restore/restorer.rb index f4f66121b87..d53d9711833 100644 --- a/lib/backup_restore/restorer.rb +++ b/lib/backup_restore/restorer.rb @@ -463,7 +463,7 @@ module BackupRestore SQL User.where("uploaded_avatar_id IS NOT NULL").find_each do |user| - Jobs.enqueue(:create_avatar_thumbnails, upload_id: user.uploaded_avatar_id, user_id: user.id) + Jobs.enqueue(:create_avatar_thumbnails, upload_id: user.uploaded_avatar_id) end end diff --git a/lib/upload_creator.rb b/lib/upload_creator.rb index de207439e32..397016bee0e 100644 --- a/lib/upload_creator.rb +++ b/lib/upload_creator.rb @@ -130,7 +130,7 @@ class UploadCreator end if @upload.errors.empty? && is_image && @opts[:type] == "avatar" && @upload.extension != "svg" - Jobs.enqueue(:create_avatar_thumbnails, upload_id: @upload.id, user_id: user_id) + Jobs.enqueue(:create_avatar_thumbnails, upload_id: @upload.id) end if @upload.errors.empty?