0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-17 13:12:53 +02:00
This commit is contained in:
Kerwin Bryant 2025-05-21 14:03:48 +00:00
parent 3e3316f825
commit a60a722784

View File

@ -835,10 +835,7 @@ type CountUserFilter struct {
// It performs a much more efficient check than counting all users.
func HasUsers(ctx context.Context) (bool, error) {
sess := db.GetEngine(ctx)
cond := builder.NewCond()
cond = cond.And(builder.Eq{"type": UserTypeIndividual})
exists, err := sess.Where(cond).Limit(1).Exist(new(User))
exists, err := sess.Exist(new(User))
if err != nil {
return false, fmt.Errorf("error checking user existence: %w", err)
}