summaryrefslogtreecommitdiffstats
path: root/routers/private
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-03-19 12:45:44 +0000
committerGitHub <noreply@github.com>2022-03-19 20:45:44 +0800
commitfb08d2b3fd04dc8fc6cbd45fd341773b817c0857 (patch)
tree5f8c5da22ab64e5421fe5ca5075ab8fe8eca9355 /routers/private
parent60fbaa90683add2a8af891fc2ca8448b9b75c92e (diff)
downloadgitea-fb08d2b3fd04dc8fc6cbd45fd341773b817c0857.tar.gz
gitea-fb08d2b3fd04dc8fc6cbd45fd341773b817c0857.zip
Do not send notification emails to inactive users (#19131)
Emails should not be sent to inactive users except for Activate and ResetPassword messages. Fix #18950 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/private')
-rw-r--r--routers/private/mail.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/private/mail.go b/routers/private/mail.go
index 8b69c38093..853b58b09d 100644
--- a/routers/private/mail.go
+++ b/routers/private/mail.go
@@ -60,7 +60,7 @@ func SendEmail(ctx *context.PrivateContext) {
}
} else {
err := user_model.IterateUser(func(user *user_model.User) error {
- if len(user.Email) > 0 {
+ if len(user.Email) > 0 && user.IsActive {
emails = append(emails, user.Email)
}
return nil