Commit e0a5e0c0 authored by Rafael Ravedutti's avatar Rafael Ravedutti

Use missing avatar file when defined avatar is not found

Signed-off-by: Rafael Ravedutti's avatarRafael Ravedutti <rrlmachado@inf.ufpr.br>
parent 55fdb242
Pipeline #15841 passed with stages
in 3 minutes and 28 seconds
......@@ -54,9 +54,15 @@ module Api::V1
path.sub!('original', params[:size])
end
send_file path,
type: @citizen.avatar_content_type,
disposition: 'inline'
begin
send_file path,
type: @citizen.avatar_content_type,
disposition: 'inline'
rescue
send_file "public/missing.png",
type: "image/png",
disposition: 'inline'
end
end
end
end
......
......@@ -134,9 +134,15 @@ module Api::V1
path.sub!('original', params[:size])
end
send_file path,
type: @city_hall.avatar_content_type,
disposition: 'inline'
begin
send_file path,
type: @city_hall.avatar_content_type,
disposition: 'inline'
rescue
send_file "public/missing.png",
type: "image/png",
disposition: 'inline'
end
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment