1
1
mirror of https://github.com/go-gitea/gitea.git synced 2024-10-02 00:31:34 +02:00
gitea/models/user
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
..
avatar.go
badge.go
email_address_test.go
email_address.go
error.go
external_login_user.go
follow_test.go
follow.go
list.go
main_test.go
openid_test.go
openid.go
redirect_test.go
redirect.go
search.go
setting_keys.go
setting_test.go
setting.go
user_test.go
user_update.go
user.go Reliable selection of admin user (#22509) 2023-01-18 10:57:16 -06:00