summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-10-31 23:51:14 +0800
committerGitHub <noreply@github.com>2022-10-31 23:51:14 +0800
commit9a70a12a341b8e7773efc661693e4b7e3199a4bd (patch)
tree2e4f3e18315ef52e68d4bfea5939d5517d3ca56b /routers
parent4ae3f762177a2cdb449b949501420e88462f8f95 (diff)
downloadgitea-9a70a12a341b8e7773efc661693e4b7e3199a4bd.tar.gz
gitea-9a70a12a341b8e7773efc661693e4b7e3199a4bd.zip
Merge db.Iterate and IterateObjects (#21641)
These two functions are similiar, merge them.
Diffstat (limited to 'routers')
-rw-r--r--routers/private/mail.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/private/mail.go b/routers/private/mail.go
index e858992aee..255e1d901d 100644
--- a/routers/private/mail.go
+++ b/routers/private/mail.go
@@ -5,6 +5,7 @@
package private
import (
+ stdCtx "context"
"fmt"
"net/http"
"strconv"
@@ -60,7 +61,7 @@ func SendEmail(ctx *context.PrivateContext) {
}
}
} else {
- err := db.IterateObjects(ctx, func(user *user_model.User) error {
+ err := db.Iterate(ctx, nil, func(ctx stdCtx.Context, user *user_model.User) error {
if len(user.Email) > 0 && user.IsActive {
emails = append(emails, user.Email)
}