diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-10-31 23:51:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-31 23:51:14 +0800 |
commit | 9a70a12a341b8e7773efc661693e4b7e3199a4bd (patch) | |
tree | 2e4f3e18315ef52e68d4bfea5939d5517d3ca56b /routers | |
parent | 4ae3f762177a2cdb449b949501420e88462f8f95 (diff) | |
download | gitea-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.go | 3 |
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) } |