fairdm.contrib.contributors.services.merge#

Person merge service that moves one person’s data to another and deletes the first.

Module Contents#

Functions#

merge_persons

Merge person_discard into person_keep in one atomic transaction.

Data#

API#

logger#

‘getLogger(…)’

merge_persons(person_keep: fairdm.contrib.contributors.models.Person, person_discard: fairdm.contrib.contributors.models.Person) → fairdm.contrib.contributors.models.Person[source]#

Merge person_discard into person_keep in one atomic transaction.

The kept person receives the discarded person’s unique contributions, identifiers, affiliations, email addresses and stored permissions on other objects, is marked claimed and active, and the discarded person is deleted. Stored permissions on projects, datasets, samples and measurements are not copied, because levels move with the contributions. Any error rolls the whole merge back.

Args: person_keep: The person that survives. person_discard: The person that is deleted.

Returns: The updated person_keep.

Raises: ClaimingError: Both arguments are the same person.