FIX: Do not schedule avatar download if image is '' (#27687)

This commit is contained in:
Natalie Tay
2024-07-03 19:50:31 +08:00
committed by GitHub
parent f3130bc6d9
commit 751750c7f8
2 changed files with 9 additions and 1 deletions

View File

@ -148,7 +148,7 @@ class Auth::ManagedAuthenticator < Auth::Authenticator
end
def retrieve_avatar(user, url)
return unless user && url
return unless user && url.present?
return if user.user_avatar.try(:custom_upload_id).present?
Jobs.enqueue(:download_avatar_from_url, url: url, user_id: user.id, override_gravatar: false)
end