From 5edb5c8b034f7cb0a14106b160f04f0c9508aa9e Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 30 Apr 2019 17:26:39 +0100 Subject: [PATCH] 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. --- app/controllers/admin/users_controller.rb | 1 + spec/requests/admin/users_controller_spec.rb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 8cd5a0f4126..0bdc7bbbafd 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -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) diff --git a/spec/requests/admin/users_controller_spec.rb b/spec/requests/admin/users_controller_spec.rb index 9ea3689d24c..451cf274160 100644 --- a/spec/requests/admin/users_controller_spec.rb +++ b/spec/requests/admin/users_controller_spec.rb @@ -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