We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e3316f commit a60a722Copy full SHA for a60a722
models/user/user.go
@@ -835,10 +835,7 @@ type CountUserFilter struct {
835
// It performs a much more efficient check than counting all users.
836
func HasUsers(ctx context.Context) (bool, error) {
837
sess := db.GetEngine(ctx)
838
- cond := builder.NewCond()
839
- cond = cond.And(builder.Eq{"type": UserTypeIndividual})
840
-
841
- exists, err := sess.Where(cond).Limit(1).Exist(new(User))
+ exists, err := sess.Exist(new(User))
842
if err != nil {
843
return false, fmt.Errorf("error checking user existence: %w", err)
844
}
0 commit comments