[openstreetmap/openstreetmap-website] WIP: Allow users to delete their own accounts (PR #3398)

Andy Allan notifications at github.com
Wed Dec 15 17:14:32 UTC 2021


Account deletion is something that administrators currently do manually, when emailed with a request, but there's no reason to prevent users from being able to delete their own accounts.

I'm opening this as a draft PR in order to get early feedback on the UI. Obviously tests need to be written, and to help with development, it doesn't actually delete the account yet :smile:

The idea is to have a button on the account editing page:

![Screenshot from 2021-12-15 16-59-00](https://user-images.githubusercontent.com/360803/146233151-6d921bb3-994d-4b8f-b9dd-31896d8d51ad.png)

Which then leads to a description of what exactly will happen when you delete your account:

![Screenshot from 2021-12-15 16-54-42](https://user-images.githubusercontent.com/360803/146232783-2c53d980-aefa-4ed6-b95f-5adbe36d876f.png)

Please let me know what you think. If you want to see exactly what happens when you delete an account currently, have a look at the reasonably straightforward [`User#destroy`](https://github.com/openstreetmap/openstreetmap-website/blob/8adb486130d867070504c2c2c705fdfe74e5d394/app/models/user.rb#L243-L259) method.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/3398

-- Commit Summary --

  * Refactor the account edit/update pages out into a separate accounts controller
  * WIP Allow users to delete their own accounts

-- File Changes --

    M .rubocop_todo.yml (1)
    M app/abilities/ability.rb (2)
    A app/controllers/account/deletions_controller.rb (12)
    A app/controllers/accounts_controller.rb (59)
    M app/controllers/application_controller.rb (2)
    A app/controllers/concerns/user_methods.rb (47)
    M app/controllers/confirmations_controller.rb (4)
    M app/controllers/users_controller.rb (89)
    A app/views/account/deletions/show.html.erb (37)
    R app/views/accounts/edit.html.erb (13)
    M app/views/application/_settings_menu.html.erb (2)
    M app/views/layouts/_header.html.erb (2)
    M app/views/sessions/new.html.erb (2)
    M app/views/site/edit.html.erb (2)
    M app/views/users/show.html.erb (2)
    M config/locales/en.yml (82)
    M config/routes.rb (7)
    A test/controllers/accounts_controller_test.rb (128)
    M test/controllers/confirmations_controller_test.rb (8)
    M test/controllers/users_controller_test.rb (140)
    M test/integration/client_applications_test.rb (4)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/3398.patch
https://github.com/openstreetmap/openstreetmap-website/pull/3398.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3398
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20211215/8ab53c44/attachment.htm>


More information about the rails-dev mailing list