Commit graph

15 commits

Author SHA1 Message Date
Yorick Peterse
d0b8f536a1
Remove soft removals related code
This removes all usage of soft removals except for the "pending delete"
system implemented for projects. This in turn simplifies all the query
plans of the models that used soft removals. Since we don't really use
soft removals for anything useful there's no point in keeping it around.

This _does_ mean that hard removals of issues (which only admins can do
if I'm not mistaken) can influence the "iid" values, but that code is
broken to begin with. More on this (and how to fix it) can be found in
https://gitlab.com/gitlab-org/gitlab-ce/issues/31114.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37447
2018-01-08 17:04:45 +01:00
Francisco Javier López
2665aea627 Fix user membership destroy relation 2018-01-02 15:06:44 +00:00
Gabriel Mazetto
fb9e059a41 Make sure repository's removal work for legacy and hashed storages 2017-08-22 06:33:20 +02:00
Robert Speicher
72a7b30c9f Change all :empty_project to :project 2017-08-02 17:47:31 -04:00
Robert Speicher
9513bd18c4 Ensure all project factories use :repository trait or :empty_project 2017-08-01 14:51:52 -04:00
Rémy Coutable
ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Nick Thomas
7db09c63cc Fix hard-deleting users when they have authored issues 2017-06-02 02:06:56 +01:00
Valery Sizov
34be1835af [Multiple issue assignee] Fix a number of specs 2017-05-05 15:30:19 +03:00
Clement Ho
c4094b7ec4 Fix specs 2017-05-04 22:34:15 -05:00
Stan Hu
60eee739f0 Hard delete users' associated records deleted from AbuseReports
In the case of spammers, we really want a hard delete to avoid retaining spam.

Closes #31021
2017-04-16 08:36:33 -07:00
Timothy Andrew
1c42505b02
Implement review comments from @DouweM for !10467.
1. Have `MigrateToGhostUser` be a service rather than a mixed-in module, to keep
   things explicit. Specs testing the behavior of this class are moved into a
   separate service spec file.

2. Add a `user.reported_abuse_reports` association to make the
   `migrate_abuse_reports` method more consistent with the other `migrate_`
   methods.
2017-04-06 22:39:40 +05:30
Timothy Andrew
3e1a1242c6
Move a user's award emoji to the ghost user
... when the user is destroyed.

1. Normally, for a given awardable and award emoji name, a user is only allowed
   to create a single award emoji.

2. This validation needs to be removed for ghost users, since:

   - User A and User B have created award emoji - with the same name and against
     the same awardable
   - User A is deleted. Their award emoji is moved to the ghost user
   - User B is deleted. Their award emoji needs to be moved to the ghost user.
     However, this breaks the uniqueness validation, since the ghost user is
     only allowed to have one award emoji of a given name for a given awardable
2017-04-06 18:59:17 +05:30
Timothy Andrew
682987547a
Move a user's abuse reports to the ghost user
... when the user is destroyed.

To clarify, this regards abuse reports that the to-be-deleted user has _reported_.
2017-04-06 18:59:16 +05:30
Timothy Andrew
97cbf7c223
Move a user's notes to the ghost user
... when the user is destroyed.
2017-04-06 18:58:59 +05:30
Timothy Andrew
72580f07af
Move a user's merge requests to the ghost user.
1. When the user is deleted.

2. Refactor out code relating to "migrating records to the ghost user" into a
   `MigrateToGhostUser` concern, which is tested using a shared example.
2017-04-06 18:58:57 +05:30
Renamed from spec/services/users/destroy_spec.rb (Browse further)