Serve system user avatar as an asset

This commit is contained in:
Stanko K.R.
2025-11-24 13:16:14 +01:00
parent e85c5736c9
commit 46d80f2ca2
3 changed files with 2 additions and 2 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 932 KiB

+1 -1
View File
@@ -8,7 +8,7 @@ class Users::AvatarsController < ApplicationController
def show
if @user.system?
redirect_to "/apple-touch-icon.png"
redirect_to view_context.image_path("system_user.png")
elsif @user.avatar.attached?
redirect_to rails_blob_url(@user.avatar.variant(:thumb), disposition: "inline")
elsif stale? @user, cache_control: cache_control
@@ -9,7 +9,7 @@ class Users::AvatarsControllerTest < ActionDispatch::IntegrationTest
get user_avatar_path(users(:system))
assert_response :redirect
assert_redirected_to "/apple-touch-icon.png"
assert_redirected_to ActionController::Base.helpers.image_path("system_user.png")
end
test "show own initials without caching" do