# Deleted user with rails console u.delete -\> email still "taken"

**URL:** <https://meta.discourse.org/t/deleted-user-with-rails-console-u-delete-email-still-taken/164868>\
**Category:** Bug\
**Created:** [September 22, 2020, 12:24pm UTC](https://meta.discourse.org/t/deleted-user-with-rails-console-u-delete-email-still-taken/164868 "2020-09-22T12:24:53Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [September 22, 2020, 4:45pm UTC](https://meta.discourse.org/t/deleted-user-with-rails-console-u-delete-email-still-taken/164868/4 "2020-09-22T16:45:27Z")

</div>

> [@Wille](#):
>
> created another admin account, and deleted the second admin account using the console, but now I can’t reuse the email I had assigned to the second admin account.
> 
> Not sure whether to put this under support or bugs.

It seems likely that this is not a bug. It depends how you deleted the user from the console.

From the console, try searching for:

```plaintext
UserEmail.where(email: '<your_deleted_users_email>')

```

If that gives you a result, try searching for the user with the `user_id` that was returned:

```plaintext
User.find_by(id: <email_record_id>)

```

My guess is that no user will be returned because the email belonged to the user you deleted. If that is the case, it should be safe to call `destroy!` on the email record. Before trying this, be sure that you have an up-to-date backup of your site.

If the email _does_ belong to an existing user, do not delete the email record.

---

_[View the full topic](https://meta.discourse.org/t/deleted-user-with-rails-console-u-delete-email-still-taken/164868)._
