1
1
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-19 17:26:58 +01: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
avatars
db
fixtures
git
issues
migrations
organization Secrets storage with SecretKey encrypted (#22142) 2022-12-20 17:07:13 +08:00
packages
perm
project
pull
repo Fix Operator does not exist bug on explore page with ONLY_SHOW_RELEVANT_REPOS (#22454) 2023-01-16 11:25:22 +00:00
secret
system Set disable_gravatar/enable_federated_avatar when offline mode is true (#22479) 2023-01-17 17:00:19 +02:00
unit
unittest Add support for incoming emails (#22056) 2023-01-14 23:57:10 +08:00
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 Secrets storage with SecretKey encrypted (#22142) 2022-12-20 17:07:13 +08:00
user.go