FIX: Create empty user_avatar row if not exist

This commit is contained in:
Vinoth Kannan 2018-07-16 14:06:49 +05:30
parent ac0053f491
commit f3868fd646
1 changed files with 2 additions and 0 deletions

View File

@ -870,6 +870,8 @@ class UsersController < ApplicationController
return render_json_error I18n.t("avatar.missing")
end
user.create_user_avatar unless user.user_avatar
if type == "gravatar"
user.user_avatar.gravatar_upload_id = upload_id
else