mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-15 15:19:36 +01:00
Backport #20171 The setting `DEFAULT_SHOW_FULL_NAME` promises to use the user's full name everywhere it can be used. Unfortunately the function `*user_model.User.ShortName()` currently uses the `.Name` instead - but this should also use the `.FullName()`. Therefore we should make `*user_model.User.ShortName()` base its pre-shortened name on the `.FullName()` function. Co-authored-by: Baekjun Kim <36013575+kimbj95@users.noreply.github.com>
This commit is contained in:
parent
c88a59bb23
commit
76ba23a14f
1 changed files with 3 additions and 0 deletions
|
@ -485,6 +485,9 @@ func (u *User) GitName() string {
|
|||
|
||||
// ShortName ellipses username to length
|
||||
func (u *User) ShortName(length int) string {
|
||||
if setting.UI.DefaultShowFullName && len(u.FullName) > 0 {
|
||||
return base.EllipsisString(u.FullName, length)
|
||||
}
|
||||
return base.EllipsisString(u.Name, length)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue