Skip to content

Commit 76ba23a

Browse files
zeripathkimbj95
andauthored
Display full name (#20171) (#20246)
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>
1 parent c88a59b commit 76ba23a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

models/user/user.go

+3
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,9 @@ func (u *User) GitName() string {
485485

486486
// ShortName ellipses username to length
487487
func (u *User) ShortName(length int) string {
488+
if setting.UI.DefaultShowFullName && len(u.FullName) > 0 {
489+
return base.EllipsisString(u.FullName, length)
490+
}
488491
return base.EllipsisString(u.Name, length)
489492
}
490493

0 commit comments

Comments
 (0)