loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix empty field `login_name` in API response JSON when creating user (#30511)

Fix #30508

ps: if `sourceID` is not set, `LoginName` will be ignored
(cherry picked from commit cf9061f44a439aa7775e301a7467dbda22a06eaa)

authored by

yp05327 and committed by
Gergely Nagy
3662829c e025ec01

+3 -3
+3 -3
routers/api/v1/admin/user.go
··· 30 30 user_service "code.gitea.io/gitea/services/user" 31 31 ) 32 32 33 - func parseAuthSource(ctx *context.APIContext, u *user_model.User, sourceID int64, loginName string) { 33 + func parseAuthSource(ctx *context.APIContext, u *user_model.User, sourceID int64) { 34 34 if sourceID == 0 { 35 35 return 36 36 } ··· 47 47 48 48 u.LoginType = source.Type 49 49 u.LoginSource = source.ID 50 - u.LoginName = loginName 51 50 } 52 51 53 52 // CreateUser create a user ··· 83 82 Passwd: form.Password, 84 83 MustChangePassword: true, 85 84 LoginType: auth.Plain, 85 + LoginName: form.LoginName, 86 86 } 87 87 if form.MustChangePassword != nil { 88 88 u.MustChangePassword = *form.MustChangePassword 89 89 } 90 90 91 - parseAuthSource(ctx, u, form.SourceID, form.LoginName) 91 + parseAuthSource(ctx, u, form.SourceID) 92 92 if ctx.Written() { 93 93 return 94 94 }