forgejo/models
Gusted 340e657392
[MODERATION] Purge issues on user deletion
- Forgejo has the option to delete users, in which all data except
issues and comments are removed, this makes sense in some cases where
users need to be removed cleanly but without removing their existing bug
reports or comments to an discussion. In the case of spammers, admins
have the option to enable purging, where comments are removed.
- Add issues to the list of things to be removed if purge is checked.
- No unit testing, as this gigantic function doesn't have one to begin
with.
- Add integration test.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1268

(cherry picked from commit 3ed381c758)
(cherry picked from commit 44d00650ce)
(cherry picked from commit 7f4da82779)
(cherry picked from commit d629314def)

Conflicts:
	models/fixtures/issue.yml
	https://codeberg.org/forgejo/forgejo/pulls/1508
(cherry picked from commit 794dcc218f)
(cherry picked from commit c433f2ecb6)
(cherry picked from commit bb23683f4b)
(cherry picked from commit 634c5604d4)
(cherry picked from commit 219073f5c5)
(cherry picked from commit 32893dbab1)
(cherry picked from commit 0ef40cfb5a)
(cherry picked from commit e535409cab3c276fd8db6b402f85934ef5127491)
(cherry picked from commit 29059f611b)
(cherry picked from commit cd480c5b8b)
2023-12-11 15:38:58 +01:00
..
actions [CLI] implement forgejo-cli 2023-12-11 13:55:27 +01:00
activities Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
admin Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
asymkey Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
auth [SECURITY] Rework long-term authentication 2023-12-11 14:48:37 +01:00
avatars Final round of db.DefaultContext refactor (#27587) 2023-10-14 08:37:24 +00:00
db [SEMVER] store SemVer in ForgejoSemVer after a database upgrade 2023-12-11 14:48:36 +01:00
dbfs make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
fixtures [MODERATION] Purge issues on user deletion 2023-12-11 15:38:58 +01:00
forgejo/semver [SEMVER] store SemVer in ForgejoSemVer after a database upgrade 2023-12-11 14:48:36 +01:00
forgejo_migrations [SECURITY] Rework long-term authentication 2023-12-11 14:48:37 +01:00
git Second part of refactor db.Find (#28194) 2023-12-11 16:56:48 +08:00
issues [FEAT] allow setting the update date on issues and comments 2023-12-11 14:48:36 +01:00
migrations [UPGRADE] run sanity checks before the database is upgraded 2023-12-11 14:48:36 +01:00
organization Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
packages Revert "packages: Calculate package size quota using package creator ID instead of owner ID (#28007)" (#28049) 2023-11-14 16:03:56 +01:00
perm Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
project Fix comment permissions (#28213) 2023-11-25 17:21:21 +00:00
pull Add Index to pull_auto_merge.doer_id (#27811) 2023-10-30 08:39:29 +00:00
repo [FEAT] allow setting the update date on issues and comments 2023-12-11 14:48:36 +01:00
secret Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
shared/types Display owner of a runner as a tooltip instead of static text (#24377) 2023-05-12 08:43:27 +00:00
system Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
unit Make actions default enabled for newly created repository if global configuraion enabled (#27482) 2023-10-10 14:45:31 +00:00
unittest [TESTS] tests.AddFixtures helper loads additional per-test fixtures 2023-12-11 14:48:36 +01:00
user [SECURITY] Rework long-term authentication 2023-12-11 14:48:37 +01:00
webhook Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
error.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
fixture_generation.go Replace more db.DefaultContext (#27628) 2023-10-15 17:46:06 +02:00
fixture_test.go Replace more db.DefaultContext (#27628) 2023-10-15 17:46:06 +02:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
org.go Refactor the function RemoveOrgUser (#27582) 2023-11-03 14:01:45 +00:00
org_team.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
org_team_test.go Reduce usage of db.DefaultContext (#27073) 2023-09-14 17:09:32 +00:00
org_test.go Replace more db.DefaultContext (#27628) 2023-10-15 17:46:06 +02:00
repo.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
repo_test.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
repo_transfer.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
repo_transfer_test.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00