Backport #26242 by @silverwind Fixes: https://github.com/go-gitea/gitea/issues/26241 Co-authored-by: silverwind <me@silverwind.io> (cherry picked from commit 2517da90aa)
2517da90aa