mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-26 06:13:57 +01:00
Add newlines for readability
This commit is contained in:
parent
fff4c3f9fc
commit
715afb2468
1 changed files with 5 additions and 1 deletions
|
@ -214,8 +214,8 @@ func createUserFromAP(ctx *context.APIContext, personId forgefed.PersonId) (*use
|
|||
if err != nil {
|
||||
return &user_model.User{}, err
|
||||
}
|
||||
|
||||
log.Info("RepositoryInbox: got person by ap: %v", person)
|
||||
|
||||
email := fmt.Sprintf("%v@%v", uuid.New().String(), personId.Host)
|
||||
loginName := personId.AsLoginName()
|
||||
name := fmt.Sprintf("%v%v", person.PreferredUsername.String(), personId.HostSuffix())
|
||||
|
@ -224,10 +224,12 @@ func createUserFromAP(ctx *context.APIContext, personId forgefed.PersonId) (*use
|
|||
if len(person.Name) == 0 {
|
||||
fullName = name
|
||||
}
|
||||
|
||||
password, err := pwd_gen.Generate(32, 10, 10, false, true)
|
||||
if err != nil {
|
||||
return &user_model.User{}, err
|
||||
}
|
||||
|
||||
user := &user_model.User{
|
||||
LowerName: strings.ToLower(person.PreferredUsername.String()),
|
||||
Name: name,
|
||||
|
@ -240,10 +242,12 @@ func createUserFromAP(ctx *context.APIContext, personId forgefed.PersonId) (*use
|
|||
Type: user_model.UserTypeRemoteUser,
|
||||
IsAdmin: false,
|
||||
}
|
||||
|
||||
overwrite := &user_model.CreateUserOverwriteOptions{
|
||||
IsActive: util.OptionalBoolFalse,
|
||||
IsRestricted: util.OptionalBoolFalse,
|
||||
}
|
||||
|
||||
if err := user_model.CreateUser(ctx, user, overwrite); err != nil {
|
||||
return &user_model.User{}, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue