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 @@ -120,10 +120,13 @@ func (a *Action) ShortActUserName() string {
120
120
return base .EllipsisString (a .GetActUserName (), 20 )
121
121
}
122
122
123
- // GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME
123
+ // GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME, or falls back to the username if it is blank.
124
124
func (a * Action ) GetDisplayName () string {
125
125
if setting .UI .DefaultShowFullName {
126
- return a .GetActFullName ()
126
+ trimmedFullName := strings .TrimSpace (a .GetActFullName ())
127
+ if len (trimmedFullName ) > 0 {
128
+ return trimmedFullName
129
+ }
127
130
}
128
131
return a .ShortActUserName ()
129
132
}
Original file line number Diff line number Diff line change @@ -739,9 +739,11 @@ func (u *User) DisplayName() string {
739
739
// GetDisplayName returns full name if it's not empty and DEFAULT_SHOW_FULL_NAME is set,
740
740
// returns username otherwise.
741
741
func (u * User ) GetDisplayName () string {
742
- trimmed := strings .TrimSpace (u .FullName )
743
- if len (trimmed ) > 0 && setting .UI .DefaultShowFullName {
744
- return trimmed
742
+ if setting .UI .DefaultShowFullName {
743
+ trimmed := strings .TrimSpace (u .FullName )
744
+ if len (trimmed ) > 0 {
745
+ return trimmed
746
+ }
745
747
}
746
748
return u .Name
747
749
}
You can’t perform that action at this time.
0 commit comments