用户组织图片不存在时处理

This commit is contained in:
xxq250 2024-07-11 16:53:48 +08:00
parent 421fba24c2
commit a18bc247bb
3 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ json.max_repo_creation organization.max_repo_creation
json.num_projects organization.num_projects
json.num_users organization.num_users
json.num_teams organization.num_teams
json.avatar_url url_to_avatar(organization)
json.avatar_url url_to_avatar(organization).blank?? User::Avatar.get_letter_avatar_url(organization.login) : url_to_avatar(organization)
json.created_at organization.created_on.strftime("%Y-%m-%d")
json.news_banner_id organization.news_banner_id
json.news_content organization.news_content

View File

@ -11,7 +11,7 @@ json.projects do
json.name owner.try(:show_real_name)
json.type owner.type
json.login owner.login
json.image_url url_to_avatar(owner)
json.image_url url_to_avatar(owner).blank?? User::Avatar.get_letter_avatar_url(owner.login) : url_to_avatar(owner)
end
json.category do

View File

@ -30,7 +30,7 @@ json.projects @projects do |project|
json.type user.type
json.name user.try(:show_real_name)
json.login user.login
json.image_url url_to_avatar(user)
json.image_url url_to_avatar(user).blank?? User::Avatar.get_letter_avatar_url(user.login) : url_to_avatar(user)
end
end