Allow externalID to be UUID (#8551) (#8624)

Signed-off-by: Wenxuan Zhao <viz@linux.com>
This commit is contained in:
guillep2k 2019-10-22 05:12:10 -03:00 committed by zeripath
parent ccf5298a2c
commit 0032278a46
6 changed files with 6 additions and 16 deletions

View file

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