1
1
mirror of https://github.com/go-gitea/gitea.git synced 2024-10-01 21:21:31 +02:00
gitea/models
Sybren 326d29dce0
Reliable selection of admin user (#22509)
When importing a repository via `gitea restore-repo`, external users
will get remapped to an admin user. This admin user is obtained via
`users.GetAdminUser()`, which unfortunately picks a more-or-less random
admin to return.

This makes it hard to predict which admin user will get assigned. This
patch orders the admin by ascending ID before choosing the first one,
i.e. it picks the admin with the lowest ID.

Even though it would be nicer to have full control over which user is
chosen, this at least gives us a predictable result.
2023-01-18 10:57:16 -06:00
..
activities
admin
asymkey
auth Support scoped access tokens (#20908) 2023-01-17 15:46:03 -06:00
avatars
db
fixtures
git
issues
migrations Support scoped access tokens (#20908) 2023-01-17 15:46:03 -06:00
organization
packages Display unreferenced packages total size in package admin panel (#22498) 2023-01-18 09:52:04 -06:00
perm
project
pull
repo
secret
system
unit
unittest
user Reliable selection of admin user (#22509) 2023-01-18 10:57:16 -06:00
webhook
error.go
fixture_generation.go
fixture_test.go
main_test.go
migrate_test.go
migrate.go
org_team_test.go
org_team.go
org_test.go
org.go
repo_collaboration_test.go
repo_collaboration.go
repo_test.go
repo_transfer_test.go
repo_transfer.go
repo.go
user.go