Skip to content

Validate Import::SourceUser#placeholder_user present unless mapping completed

What does this MR do and why?

This MR adds a validation to require a placeholder_user to be present unless the record is in a completed status. When a placeholder user's contributions are finished being assigned, the placeholder user record will be deleted and the ON DELETE SET NULL on the foreign key will nullify the column.

We believe it's not possible for these records to be deleted outside of being deleted after placeholder contributions have been assigned. In the admin UI the delete user links are hidden for non-human users.

So we feel we don't need to consider scenarios where the placeholder user is deleted before the placeholder user contributions are assigned and then causing the model to consider the record to be invalid.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports