# How to activate and unstage accounts for imported users

**URL:** https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916
**Category:** Support
**Created:** [27 juli 2020 om 09:12 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916 "2020-07-27T09:12:52Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Julien\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/julien_j/32/188145_2.png) [@Julien\_J](https://meta.discourse.org/u/Julien_J)
#### Post date: [27 juli 2020 om 09:12 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/1 "2020-07-27T09:12:53Z")

</div>

Hello,

I imported posts from a mailing list and users have been successfully created.  
But now there are in “staged” list.

So i can activate them one by one, but how to activate them in bulk mode ?  
And how to unstage them too ? I don’t see any button to unstage a user.

 ![2020-07-27_11h12_09](https://global.discourse-cdn.com/meta/original/3X/b/f/bf91820841d381dac95ad24010c2957d5cc35f56.png)

Then, users are in my pending list and even then, is there a way to approve them in bulk ?

Thanks.

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [27 juli 2020 om 10:27 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/2 "2020-07-27T10:27:36Z")

</div>

the easy way is to use the [data explorer](https://meta.discourse.org/t/32566?silent=true)

[https://github.com/discourse/discourse-data-explorer.git](https://github.com/discourse/discourse-data-explorer.git)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [27 juli 2020 om 20:30 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/3 "2020-07-27T20:30:07Z")

</div>

The [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin does not let you modify data.

[Administrative Bulk Operations](https://meta.discourse.org/t/administrative-bulk-operations/118349#heading--3) should have some hints.

Something like

```
User.all.update_all(active: true)

```

might do it.

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [27 juli 2020 om 21:42 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/4 "2020-07-27T21:42:51Z")

</div>

That might do it but if emails haven’t been validated prior, during, or after the import, then there will be trouble. It will probably work with a mailing list but it’s not best practice to do this in general.

The recommended approach is to encourage your users to come to the site and create an account with the email they used on the mailing list. If the email matches the email of a staged user, the user will assume control of the staged account. If not, a new account will be created.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [27 juli 2020 om 21:56 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/5 "2020-07-27T21:56:49Z")

</div>

Just for the record, @Julien_J, I answered your question, but Justin’s is a better answer!

---

<div class="post-metadata">

### Author: ![Julien\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/julien_j/32/188145_2.png) [@Julien\_J](https://meta.discourse.org/u/Julien_J)
#### Post date: [29 juli 2020 om 12:18 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/6 "2020-07-29T12:18:47Z")

</div>

Hello,

I went to try to invite all users.  
They well received the invite email but when they try to create an account with name and password, when they click on “Accept invite”, nothing’s happening.

So i tried to invite somebody that is not already a staged user and here it’s working fine.

If i watch the Chrome console, i can see an error like that

```
_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:10113 PUT https://www.domain.tld/invites/show/f38d1e480cd9fb2d218c0d7aeddafded.json 500
send @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:10113
ajax @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:9696
i @ _application-fe142cfba5f192f0e63470885009a5a5bfbf952412fc41b59ea670a3ae4c7e27.js:9027
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:72238
n @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:72760
r @ _application-fe142cfba5f192f0e63470885009a5a5bfbf952412fc41b59ea670a3ae4c7e27.js:9041
submit @ _application-fe142cfba5f192f0e63470885009a5a5bfbf952412fc41b59ea670a3ae4c7e27.js:34690
t._join @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:67257
t.join @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66968
f @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:53760
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:20968
r @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:50091
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:20967
click @ _application-fe142cfba5f192f0e63470885009a5a5bfbf952412fc41b59ea670a3ae4c7e27.js:49429
trigger @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:46074
e @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:43433
t._run @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:67275
t._join @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:67251
t.join @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66968
f @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:53760
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:46175
r @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:50091
handleEvent @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:46171
handleEvent @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:45108
(anonymous) @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:45498
dispatch @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:5443
v.handle @ _ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:5247
_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:38545 Uncaught Error: [object Object]
    at _application-fe142cfba5f192f0e63470885009a5a5bfbf952412fc41b59ea670a3ae4c7e27.js:34720
    at E (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:72211)
    at w (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:72194)
    at g (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:72130)
    at t.invoke (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66552)
    at e.t.flush (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66442)
    at e.t.flush (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66646)
    at e.t._end (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:67222)
    at e.t.end (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:66908)
    at e.t._run (_ember_jquery-1ed3f3559e6f967733b4088aa729ff7039dff2c09c5a5f787a214b016f58aabc.js:67277) 

```

I’m on the the latest-release +486.

---

<div class="post-metadata">

### Author: ![Julien\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/julien_j/32/188145_2.png) [@Julien\_J](https://meta.discourse.org/u/Julien_J)
#### Post date: [29 juli 2020 om 12:32 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/7 "2020-07-29T12:32:38Z")

</div>

And I went to see logs where I have:  
Message (5 copies reported)

```
Reviewable::InvalidAction (Can't peform `approve_user` on ReviewableUser)
app/models/reviewable.rb:346:in `perform'
app/models/invite_redeemer.rb:149:in `approve_account_if_needed'
app/models/invite_redeemer.rb:81:in `process_invitation'
app/models/invite_redeemer.rb:8:in `block in redeem'
app/models/invite_redeemer.rb:6:in `redeem'
app/models/invite.rb:85:in `redeem'
app/controllers/invites_controller.rb:52:in `perform_accept_invitation'
app/controllers/application_controller.rb:350:in `block in with_resolved_locale'
app/controllers/application_controller.rb:350:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:68:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:328:in `call'
config/initializers/100-quiet_logger.rb:19:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:22:in `call'
lib/middleware/request_tracker.rb:176:in `call'

Backtrace

app/models/reviewable.rb:346:in `perform'
app/models/invite_redeemer.rb:149:in `approve_account_if_needed'
app/models/invite_redeemer.rb:81:in `process_invitation'
app/models/invite_redeemer.rb:8:in `block in redeem'
activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'

```

Env

HTTP HOSTS: www.domain.tld

---

<div class="post-metadata">

### Author: ![Julien\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/julien_j/32/188145_2.png) [@Julien\_J](https://meta.discourse.org/u/Julien_J)
#### Post date: [29 juli 2020 om 13:27 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/8 "2020-07-29T13:27:10Z")

</div>

Otherwise, if the staged user try to use password forgotten function to use a new password, he gets a user not found…

---

<div class="post-metadata">

### Author: ![Julien\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/julien_j/32/188145_2.png) [@Julien\_J](https://meta.discourse.org/u/Julien_J)
#### Post date: [16 augustus 2020 om 09:01 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/9 "2020-08-16T09:01:18Z")

</div>

Do you have an idea how to solve that ?

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [16 augustus 2020 om 12:16 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/10 "2020-08-16T12:16:46Z")

</div>

@Julien_J DM me your site address and let me see if I can help you

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [27 augustus 2020 om 11:02 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/11 "2020-08-27T11:02:27Z")

</div>

Hello,  
I have the same issue. Did you solve it somehow? Thank you! 🙂

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [30 augustus 2020 om 19:17 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/12 "2020-08-30T19:17:12Z")

</div>

he still has not DM’d me. so either he came right or it is still pending

---

<div class="post-metadata">

### Author: ![Julien\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/julien_j/32/188145_2.png) [@Julien\_J](https://meta.discourse.org/u/Julien_J)
#### Post date: [9 september 2020 om 10:06 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/13 "2020-09-09T10:06:34Z")

</div>

Hello, I’m sorry for my non-answer.  
In fact my forum is only in private mode, so it’s difficult to do something with the URL.

As you can see in my previous messages, the invitation was well received but the users couldn’t do anything with it.To resolve it, and because I’m on a small list with less than 10 users, I modified the email for each user with an email of mine (with dynamic alias on Gmail like [myemail+user1@gmail.com](mailto:myemail+user1@gmail.com)), and use forgot password to set a password, and then change the email to put the good user email address.

It’s not a good way but it’s work.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2 december 2020 om 13:11 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/14 "2020-12-02T13:11:26Z")

</div>

Sorted in

> [@Can't peform \`approve\_user\` on ReviewableUser](https://meta.discourse.org/t/cant-peform-approve-user-on-reviewableuser/161028/3):
>
> Fixed via: Thanks for reporting this issue @Julien_J +1

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2 december 2020 om 13:11 UTC](https://meta.discourse.org/t/how-to-activate-and-unstage-accounts-for-imported-users/158916/15 "2020-12-02T13:11:30Z")

</div>


