Skip to content

Commit

Permalink
Fixes day calculation for grace_period
Browse files Browse the repository at this point in the history
  • Loading branch information
laugmanuel authored and ekohl committed May 17, 2024
1 parent 1df3c35 commit 2765128
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/concerns/foreman_expire_hosts/host_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ def expired?
def expiration_grace_period_end_date
return nil unless expires?

expired_on.to_date + Setting[:days_to_delete_after_host_expiration].to_i
expired_on.to_date + Setting[:days_to_delete_after_host_expiration].to_i.days
end

def expired_past_grace_period?
return false unless expires?

expiration_grace_period_end_date <= Date.today
expiration_grace_period_end_date.to_date <= Date.today
end

def pending_expiration?
return false unless expires?
return false if expired?

expired_on - Setting['notify1_days_before_host_expiry'].to_i <= Date.today
expired_on.to_date - Setting['notify1_days_before_host_expiry'].to_i.days <= Date.today
end

def can_modify_expiry_date?
Expand Down

0 comments on commit 2765128

Please sign in to comment.