1
1
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-19 17:14:49 +01: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 Fix get system setting bug when enabled redis cache (#22295) 2023-01-02 00:06:52 +08:00
badge.go
email_address_test.go refactor some functions to support ctx as first parameter (#21878) 2022-12-03 10:48:26 +08:00
email_address.go Use ErrInvalidArgument in packages (#22268) 2022-12-31 12:49:37 +01:00
error.go
external_login_user.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
follow_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
follow.go
list.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
main_test.go
openid_test.go
openid.go Use ErrInvalidArgument in packages (#22268) 2022-12-31 12:49:37 +01:00
redirect_test.go
redirect.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
search.go
setting_keys.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
setting_test.go
setting.go Fix get system setting bug when enabled redis cache (#22295) 2023-01-02 00:06:52 +08:00
user_test.go refactor some functions to support ctx as first parameter (#21878) 2022-12-03 10:48:26 +08:00
user_update.go
user.go Reliable selection of admin user (#22509) 2023-01-18 10:57:16 -06:00