From 88b474e6e9ee8909508eebfa9c779a83d2bbef62 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Mon, 24 Apr 2017 11:55:15 +0200 Subject: [PATCH] Fixed issue #975 - Exception in OTRS Import. --- app/models/user.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index 66a53ad8c..cd6aa9deb 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -903,6 +903,8 @@ raise 'Minimum one user need to have admin permissions' =end def last_admin_check(role) + return if Setting.get('import_mode') + ticket_admin_role_ids = Role.joins(:permissions).where(permissions: { name: ['admin', 'admin.user'] }).pluck(:id) count = User.joins(:roles).where(roles: { id: ticket_admin_role_ids }, users: { active: true }).count if ticket_admin_role_ids.include?(role.id)