mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 21:10:17 +08:00
FIX: sso with avatar override may fail on first account creation
This commit is contained in:
parent
508efe3029
commit
034967328c
|
@ -134,6 +134,10 @@ class DiscourseSingleSignOn < SingleSignOn
|
|||
upload = Upload.create_for(user.id, tempfile, "external-avatar." + ext, File.size(tempfile.path), { origin: avatar_url })
|
||||
user.uploaded_avatar_id = upload.id
|
||||
|
||||
unless user.user_avatar
|
||||
user.build_user_avatar
|
||||
end
|
||||
|
||||
if !user.user_avatar.contains_upload?(upload.id)
|
||||
user.user_avatar.custom_upload_id = upload.id
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user