|
|
@ -5,8 +5,6 @@ |
|
|
|
package migrations |
|
|
|
package migrations |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"strconv" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/structs" |
|
|
|
"code.gitea.io/gitea/modules/structs" |
|
|
@ -40,11 +38,7 @@ func updateMigrationPosterIDByGitService(tp structs.GitServiceType) error { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for _, user := range users { |
|
|
|
for _, user := range users { |
|
|
|
externalUserID, err := strconv.ParseInt(user.ExternalID, 10, 64) |
|
|
|
externalUserID := user.ExternalID |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
log.Warn("Parse externalUser %#v 's userID failed: %v", user, err) |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if err := models.UpdateMigrationsByType(tp, externalUserID, user.UserID); err != nil { |
|
|
|
if err := models.UpdateMigrationsByType(tp, externalUserID, user.UserID); err != nil { |
|
|
|
log.Error("UpdateMigrationsByType type %s external user id %v to local user id %v failed: %v", tp.Name(), user.ExternalID, user.UserID, err) |
|
|
|
log.Error("UpdateMigrationsByType type %s external user id %v to local user id %v failed: %v", tp.Name(), user.ExternalID, user.UserID, err) |
|
|
|
} |
|
|
|
} |
|
|
|