Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix not_builtin scope

Jan Sandbrinke1ba97f61dea
diff --git a/app/models/principals/scopes/not_builtin.rb b/app/models/principals/scopes/not_builtin.rb
index 2585c06b984..5d44ece3dcd 100644
--- a/app/models/principals/scopes/not_builtin.rb
+++ b/app/models/principals/scopes/not_builtin.rb
@@ -40,7 +40,8 @@ module Principals::Scopes
def not_builtin
where.not(type: [SystemUser.name,
AnonymousUser.name,
- DeletedUser.name])
+ DeletedUser.name,
+ ServiceAccount.name])
end
end
end
diff --git a/spec/models/principals/scopes/not_builtin_spec.rb b/spec/models/principals/scopes/not_builtin_spec.rb
index 5f20821525a..7c0dfff64f5 100644
--- a/spec/models/principals/scopes/not_builtin_spec.rb
+++ b/spec/models/principals/scopes/not_builtin_spec.rb
@@ -36,6 +36,7 @@ RSpec.describe Principals::Scopes::NotBuiltin do
let!(:group) { create(:group) }
let!(:user) { create(:user) }
let!(:placeholder_user) { create(:placeholder_user) }
+ let!(:service_account) { create(:service_account) }
subject { Principal.not_builtin }