Fixed issue #975 - Exception in OTRS Import.
This commit is contained in:
parent
6b405ce87b
commit
88b474e6e9
1 changed files with 2 additions and 0 deletions
|
@ -903,6 +903,8 @@ raise 'Minimum one user need to have admin permissions'
|
||||||
=end
|
=end
|
||||||
|
|
||||||
def last_admin_check(role)
|
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)
|
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
|
count = User.joins(:roles).where(roles: { id: ticket_admin_role_ids }, users: { active: true }).count
|
||||||
if ticket_admin_role_ids.include?(role.id)
|
if ticket_admin_role_ids.include?(role.id)
|
||||||
|
|
Loading…
Reference in a new issue