FIX: don't update gravatar if the user has no email
This commit is contained in:
parent
cc1f9e7be6
commit
e3a23116d2
|
@ -8,7 +8,7 @@ module Jobs
|
||||||
user = User.find_by(id: args[:user_id])
|
user = User.find_by(id: args[:user_id])
|
||||||
avatar = UserAvatar.find_by(id: args[:avatar_id])
|
avatar = UserAvatar.find_by(id: args[:avatar_id])
|
||||||
|
|
||||||
if user && avatar && avatar.user&.id == user.id
|
if user && avatar && avatar.user&.id == user.id && user.email.present?
|
||||||
avatar.update_gravatar!
|
avatar.update_gravatar!
|
||||||
if !user.uploaded_avatar_id && avatar.gravatar_upload_id
|
if !user.uploaded_avatar_id && avatar.gravatar_upload_id
|
||||||
user.update_column(:uploaded_avatar_id, avatar.gravatar_upload_id)
|
user.update_column(:uploaded_avatar_id, avatar.gravatar_upload_id)
|
||||||
|
|
Loading…
Reference in New Issue