forgejo_backup/models/user
Earl Warren 9e6f722f94 fix: only send Forgejo Actions notifications to one user (#8227)
- If the run was attributed to a system user (which is the case for scheduled runs for instance), ignore it and fallback to the mail of the owner. System users may have email addresses, but they are not to be used.
- If the owner is a system user or an organization with no email associated with it, do nothing.
- If a user with an email exists, check if they did not disable notifications and send the email.

Refs: https://codeberg.org/forgejo/forgejo/issues/8187
Refs: https://codeberg.org/forgejo/forgejo/issues/8233

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.

### Documentation

- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [x] I do not want this change to show in the release notes.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8227
Reviewed-by: Christopher Besch <mail@chris-besch.com>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-06-21 12:15:38 +02:00
..
fixtures Implement remote user login source and promotion to regular user 2024-04-25 13:03:49 +02:00
activitypub.go add port and schema to federation host (#7203) 2025-04-16 08:07:51 +00:00
avatar.go Return default avatar url when user id is zero rather than updating database (#34094) 2025-04-07 16:48:15 +02:00
avatar_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
badge.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
block.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
block_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
email_address.go chore(sec): unify usage of crypto/rand.Read (#7453) 2025-04-04 03:31:37 +00:00
email_address_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
error.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
external_login_user.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
federated_user.go Federated user activity following: Isolated model changes (#8078) 2025-06-21 12:02:58 +02:00
federated_user_follower.go Federated user activity following: Isolated model changes (#8078) 2025-06-21 12:02:58 +02:00
federated_user_follower_test.go Federated user activity following: Isolated model changes (#8078) 2025-06-21 12:02:58 +02:00
federated_user_test.go Federated user activity following: Isolated model changes (#8078) 2025-06-21 12:02:58 +02:00
follow.go Federated user activity following: Isolated model changes (#8078) 2025-06-21 12:02:58 +02:00
follow_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
list.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
main_test.go chore: merge tests.AddFixtures and unittest.OverrideFixtures (#7648) 2025-04-25 09:14:33 +00:00
moderation.go feat!: Abusive content reporting (#6977) 2025-05-18 08:05:16 +00:00
must_change_password.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
openid.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
openid_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
redirect.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
redirect_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
search.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
setting.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
setting_keys.go Add codespell support and fix a good number of typos with its help (#3270) 2024-05-09 13:49:37 +00:00
setting_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
user.go feat: add validating user password as trace region (#7981) 2025-05-28 14:46:23 +02:00
user_repository.go Federated user activity following: Isolated model changes (#8078) 2025-06-21 12:02:58 +02:00
user_system.go fix: only send Forgejo Actions notifications to one user (#8227) 2025-06-21 12:15:38 +02:00
user_test.go Federated user activity following: Isolated model changes (#8078) 2025-06-21 12:02:58 +02:00
user_update.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00