File tree 2 files changed +10
-5
lines changed 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,13 @@ func (a *Action) ShortActUserName() string {
122
122
return base .EllipsisString (a .GetActUserName (), 20 )
123
123
}
124
124
125
- // GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME
125
+ // GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME, or falls back to the username if it is blank.
126
126
func (a * Action ) GetDisplayName () string {
127
127
if setting .UI .DefaultShowFullName {
128
- return a .GetActFullName ()
128
+ trimmedFullName := strings .TrimSpace (a .GetActFullName ())
129
+ if len (trimmedFullName ) > 0 {
130
+ return trimmedFullName
131
+ }
129
132
}
130
133
return a .ShortActUserName ()
131
134
}
Original file line number Diff line number Diff line change @@ -712,9 +712,11 @@ func (u *User) DisplayName() string {
712
712
// GetDisplayName returns full name if it's not empty and DEFAULT_SHOW_FULL_NAME is set,
713
713
// returns username otherwise.
714
714
func (u * User ) GetDisplayName () string {
715
- trimmed := strings .TrimSpace (u .FullName )
716
- if len (trimmed ) > 0 && setting .UI .DefaultShowFullName {
717
- return trimmed
715
+ if setting .UI .DefaultShowFullName {
716
+ trimmed := strings .TrimSpace (u .FullName )
717
+ if len (trimmed ) > 0 {
718
+ return trimmed
719
+ }
718
720
}
719
721
return u .Name
720
722
}
You can’t perform that action at this time.
0 commit comments