Skip to content

Commit

Permalink
Users without groups should use admin retirement
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed Sep 20, 2019
1 parent 76e3ac6 commit 3529179
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/mixins/retirement_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,12 @@ def valid_zone?

def system_context_requester
if try(:evm_owner_id).present?
if User.find_by(:id => evm_owner_id).present?
user = User.find_by(:id => evm_owner_id)
if user.present? && user.current_group.present?
return evm_owner
elsif user.present? && !user.current_group.present?
$log.info("#{name} has evm_owner present but user has no group so defaulting to admin.")
return User.super_admin
else
$log.info("#{name} has evm_owner_id present but no user with that id found so defaulting to admin.")
return User.super_admin
Expand Down

0 comments on commit 3529179

Please sign in to comment.