[PR #2384] [MERGED] Prevent sending emails and notifications to inactive users #16379

Closed
opened 2025-11-02 12:09:16 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2384
Author: @daviian
Created: 8/24/2017
Status: Merged
Merged: 9/16/2017
Merged by: @lunny

Base: masterHead: inactive-user-receive-mail-fix


📝 Commits (7)

  • 22537f0 Filter inactive users before sending emails or creating browser notifications
  • d08001f fix formatting issues
  • 76aace8 included requested changes
  • 9bcaa0d optimized database queries
  • 669b5df rebasing new master and add tablenames for clarification in xorm queries
  • fdc0f6c remove escaped quotationmarks using backticks
  • 7047786 Merge branch 'master' into inactive-user-receive-mail-fix

📊 Changes

13 files changed (+85 additions, -21 deletions)

View changed files

📝 models/fixtures/repository.yml (+1 -1)
📝 models/fixtures/watch.yml (+5 -0)
📝 models/issue.go (+5 -2)
📝 models/issue_mail.go (+6 -2)
📝 models/issue_test.go (+2 -1)
📝 models/issue_watch.go (+4 -1)
📝 models/issue_watch_test.go (+5 -0)
📝 models/migrations/migrations.go (+2 -0)
models/migrations/v41.go (+42 -0)
📝 models/notification_test.go (+2 -3)
📝 models/repo_watch.go (+5 -1)
📝 models/repo_watch_test.go (+5 -9)
📝 models/user.go (+1 -1)

📄 Description

Targets https://github.com/go-gitea/gitea/issues/2034

Added checks if user is inactive (is_active = false or prohibit_login = true) before creating notifications and sending mails.
Furthermore I added NOT NULL DEFAULT false to prohibit_login field.

Changed unit tests accordingly and added a migration, which I tested for mssql, mysql and postgresql.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2384 **Author:** [@daviian](https://github.com/daviian) **Created:** 8/24/2017 **Status:** ✅ Merged **Merged:** 9/16/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `inactive-user-receive-mail-fix` --- ### 📝 Commits (7) - [`22537f0`](https://github.com/go-gitea/gitea/commit/22537f0e395742009d6c0c329e8f970ba1e8f9d8) Filter inactive users before sending emails or creating browser notifications - [`d08001f`](https://github.com/go-gitea/gitea/commit/d08001fb0d99d0da2bb805d483975f5c9ba8b6ab) fix formatting issues - [`76aace8`](https://github.com/go-gitea/gitea/commit/76aace848b4a62254fff67a4d7acce344a01c04a) included requested changes - [`9bcaa0d`](https://github.com/go-gitea/gitea/commit/9bcaa0dedd265e2482a9fbdefbbf219c3f695c6d) optimized database queries - [`669b5df`](https://github.com/go-gitea/gitea/commit/669b5dfafa727eb2a0ad1c783a627a7ecbf5bd56) rebasing new master and add tablenames for clarification in xorm queries - [`fdc0f6c`](https://github.com/go-gitea/gitea/commit/fdc0f6c4728a2bee0d8458921697dbebd136e725) remove escaped quotationmarks using backticks - [`7047786`](https://github.com/go-gitea/gitea/commit/7047786c00027e447b553f19d1ac9f31ef694db8) Merge branch 'master' into inactive-user-receive-mail-fix ### 📊 Changes **13 files changed** (+85 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `models/fixtures/repository.yml` (+1 -1) 📝 `models/fixtures/watch.yml` (+5 -0) 📝 `models/issue.go` (+5 -2) 📝 `models/issue_mail.go` (+6 -2) 📝 `models/issue_test.go` (+2 -1) 📝 `models/issue_watch.go` (+4 -1) 📝 `models/issue_watch_test.go` (+5 -0) 📝 `models/migrations/migrations.go` (+2 -0) ➕ `models/migrations/v41.go` (+42 -0) 📝 `models/notification_test.go` (+2 -3) 📝 `models/repo_watch.go` (+5 -1) 📝 `models/repo_watch_test.go` (+5 -9) 📝 `models/user.go` (+1 -1) </details> ### 📄 Description Targets https://github.com/go-gitea/gitea/issues/2034 Added checks if user is inactive (`is_active = false` or `prohibit_login = true`) before creating notifications and sending mails. Furthermore I added `NOT NULL DEFAULT false` to `prohibit_login` field. Changed unit tests accordingly and added a migration, which I tested for mssql, mysql and postgresql. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:09:16 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16379