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
user.active = true
user.approved = true
user.save!
user.grant_admin!
user.change_trust_level!(4)

View File

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