mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-16 15:02:43 +00:00
migrations: Map non-existant external users to Ghost
When performing migrations, and need to remap external users to local ones, when no local mapping is possible, map the external user to Ghost, rather than the user who initiated the migration. Mapping the external user to the migration initiator has the potential of breaking assumptions elsewhere, like only having one review per pull request per user. Mapping these migrated, locally unavailable users to Ghost makes sure these - often hidden - assumptions do not break. Fixes #3860. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
This commit is contained in:
parent
95ccbb5995
commit
ade7304eea
3 changed files with 8 additions and 7 deletions
|
@ -996,7 +996,7 @@ func (g *GiteaLocalUploader) remapUser(source user_model.ExternalUserMigrated, t
|
|||
if userID > 0 {
|
||||
return target.RemapExternalUser("", 0, userID)
|
||||
}
|
||||
return target.RemapExternalUser(source.GetExternalName(), source.GetExternalID(), g.doer.ID)
|
||||
return target.RemapExternalUser(source.GetExternalName(), source.GetExternalID(), user_model.GhostUserID)
|
||||
}
|
||||
|
||||
func (g *GiteaLocalUploader) remapLocalUser(source user_model.ExternalUserMigrated) (int64, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue