mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-19 19:18:43 +02:00
fix
This commit is contained in:
parent
3e3316f825
commit
a60a722784
@ -835,10 +835,7 @@ type CountUserFilter struct {
|
|||||||
// It performs a much more efficient check than counting all users.
|
// It performs a much more efficient check than counting all users.
|
||||||
func HasUsers(ctx context.Context) (bool, error) {
|
func HasUsers(ctx context.Context) (bool, error) {
|
||||||
sess := db.GetEngine(ctx)
|
sess := db.GetEngine(ctx)
|
||||||
cond := builder.NewCond()
|
exists, err := sess.Exist(new(User))
|
||||||
cond = cond.And(builder.Eq{"type": UserTypeIndividual})
|
|
||||||
|
|
||||||
exists, err := sess.Where(cond).Limit(1).Exist(new(User))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, fmt.Errorf("error checking user existence: %w", err)
|
return false, fmt.Errorf("error checking user existence: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user