Skip to content

Commit 7d1d708

Browse files
maggie-loubduffany
andauthored
Use the github username as the name, if no name is set. (#9388)
The UI renders that value [here](https://github.com/buildbuddy-io/buildbuddy/blob/master/enterprise/app/org/org_members.tsx#L253) Fixes [this](https://buildbuddy-corp.slack.com/archives/C0495TM9UUE/p1747423662459899) --------- Co-authored-by: Brandon Duffany <brandon@buildbuddy.io>
1 parent a1a158c commit 7d1d708

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/tables/tables.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,17 @@ func (u *User) TableName() string {
312312
}
313313

314314
func (u *User) ToProto() *uspb.DisplayUser {
315+
name := strings.TrimSpace(u.FirstName + " " + u.LastName)
316+
// Use the github username as the name, if no name is set.
317+
if name == "" && strings.HasPrefix(u.SubID, "https://github.com/") {
318+
name = strings.TrimPrefix(u.SubID, "https://github.com/")
319+
}
315320
return &uspb.DisplayUser{
316321
UserId: &uspb.UserId{
317322
Id: u.UserID,
318323
},
319324
Name: &uspb.Name{
320-
Full: strings.TrimSpace(u.FirstName + " " + u.LastName),
325+
Full: name,
321326
First: u.FirstName,
322327
Last: u.LastName,
323328
},

0 commit comments

Comments
 (0)