FIX: Mark invited admins as 'approved' (#7459)

This prevents invited admins appearing as no-op reviewables in the queue when invite_only or require_approval is enabled.
This commit is contained in:
David Taylor 2019-04-30 17:26:39 +01:00 committed by GitHub
parent 583226d295
commit 5edb5c8b03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -503,6 +503,7 @@ class Admin::UsersController < Admin::AdminController
end end
user.active = true user.active = true
user.approved = true
user.save! user.save!
user.grant_admin! user.grant_admin!
user.change_trust_level!(4) user.change_trust_level!(4)

View File

@ -796,6 +796,8 @@ RSpec.describe Admin::UsersController do
expect(u.name).to eq("Bill") expect(u.name).to eq("Bill")
expect(u.username).to eq("bill22") expect(u.username).to eq("bill22")
expect(u.admin).to eq(true) expect(u.admin).to eq(true)
expect(u.active).to eq(true)
expect(u.approved).to eq(true)
end end
it "doesn't send the email with send_email falsey" do it "doesn't send the email with send_email falsey" do