mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: Create empty user_avatar row if not exist
This commit is contained in:
parent
ac0053f491
commit
f3868fd646
1 changed files with 2 additions and 0 deletions
|
@ -870,6 +870,8 @@ class UsersController < ApplicationController
|
||||||
return render_json_error I18n.t("avatar.missing")
|
return render_json_error I18n.t("avatar.missing")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
user.create_user_avatar unless user.user_avatar
|
||||||
|
|
||||||
if type == "gravatar"
|
if type == "gravatar"
|
||||||
user.user_avatar.gravatar_upload_id = upload_id
|
user.user_avatar.gravatar_upload_id = upload_id
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue