Deleting an account
Closed this issue · 10 comments
As I had too many accounts on dev, mainly created for live demonstrations (see #178 ), I would like to delete them. However, I don't think it's possible. I think the users should be allowed to delete their own account, if they wish to do so. What do you think, @niconoe? Front-end speaking, I think a red button in My Profile page would be enough. And the typical "Are you sure?" question when the user clicks on it.
Indeed, it would be good to provide such a feature to the users.
In the current state of affairs, that can be done by any Admin in the admin section. Is there an account on dev I can delete for you?
You can delete all of them. I will make a new one afterwards. Thanks.
Actually I can delete them as I have admin rights, indeed 👍
Indeed, problems as you mentioned in #180
I've deleted your accounts, @damianooldoni. Tell me when you have created a new one (so I can promote you to admin)
Thanks @niconoe. I have just now created a new account on dev.
username: damianooldoni
email: damiano.oldoni@inbo.be
I will use this as main account, so please provide it admin rights. Thanks.
Done!
Update: This is now implemented in the user_can_delete_their_account
branch. I also made some changes to the comments system so the user's comments are "emptied" rather than deleted. When a user delete its account, its comments lose their content and author, but still appear as a deleted entry on the observation page (this is to avoid confusing conversations in case users make longish exchanges about an observation).
This feature has low-level (models) tests, but still lacks high-level testing:
- tests for the
delete_own_account
view (also check that all related entities are removed and that the session is terminated) - a selenium test checking for the client side flow, including the validation modal, and making sure they can't sign in anymore after that operation.
Hey @damianooldoni : this is now implemented, and the result is visible on https://dev-alert.riparias.be (there's a new button on the my profile
page). Can you have a look?
Great! It works.
I got a new issue I think: I made a test account (just for this issue) using the very same email address of another existing account.
After deletion of the test account I clicked on "Lost password" and so tried to log in back. What I did is that I got an email reminding me that the account is called "damianooldoni":
You're receiving this email because you requested a password reset for your user account at dev-alert.riparias.be.
Please go to the following page and choose a new password:
https://dev-alert.riparias.be/accounts/reset/xxx/xxxxxxxxxx
Your username, in case you’ve forgotten: damianooldoni
Thanks for using our site!
The dev-alert.riparias.be team