Skip to content

Add user account deletion process

Jérémie Pardou requested to merge 880-user-account-deletion into develop

This MR adds the workflow for user account self deletion.

image

Workflow

When a user wants to delete her account:

  • She open the account deletion modal from her account menu.
  • Then she can check which groups are going to be deleted (if there is any). if she wants she can manually give admin permissions to other users.
  • If the user is ready, she can enter her current password and click on the delete button.
  • If the password is valid, the account is scheduled for deletion and the user is logged out.
  • If the user wants to cancel her account deletion, she just have to log in again. A mail is sent to explain everything when she schedule the deletion and if she cancel the deletion.
  • If she doesn't, the account is permanently deleted after X days (default 30) by a periodic task. X is a value configured by the instance administrator in the settings panel (see below). A mail is sent to confirm the account deletion.
  • When a user is deleted, all orphan groups are also deleted (and by cascading all group content). A group is an orphan if there are no more user with ADMIN permissions in this group.

The new setting panel:

image

Email templates probably need a better wording, please feel free to add some changes to the merge request.

Tests

To test this feature easily you can add the following settings to your local.py django settings to reduce waiting times ;-) Use also Mailhog to check the emails.

FORCE_ACCOUNT_DELETION_GRACE_DELAY = datetime.timedelta(minutess=2)
CHECK_PENDING_ACCOUNT_DELETION_INTERVAL = datetime.timedelta(seconds=30)

Merge Request Checklist

  • changelog.md has been updated if required
  • New/updated Premium features are separated correctly in the premium folder
  • The latest Chrome and Firefox have been used to test any new frontend features
  • Documentation has been updated
  • Quality Standards are met
  • Performance: tables are still fast with 100k+ rows, 100+ field tables
  • The redoc API pages have been updated for any REST API changes
  • Our custom API docs are updated for changes to endpoints accessed via api tokens
  • The UI/UX has been updated following UI Style Guide

Closes #880 (closed)

Edited by Jérémie Pardou

Merge request reports