Skip to content

Commit

Permalink
If the tenant_identity is not definef use the admin
Browse files Browse the repository at this point in the history
  • Loading branch information
mkanoor committed Feb 27, 2017
1 parent 7c19f64 commit 5a4e3b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/miq_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,10 @@ def ipaddress(record)
end

def target_user(record)
record.respond_to?(:tenant_identity) ? record.tenant_identity : User.find("admin")
record.respond_to?(:tenant_identity) ? record.tenant_identity : default_user
end

def default_user
User.super_admin.tap { |u| u.current_group = Tenant.root_tenant.default_miq_group }
end
end

0 comments on commit 5a4e3b5

Please sign in to comment.