mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Renew: Attach uneligibility reason
This commit is contained in:
parent
9976e3dd93
commit
29897043b0
3 changed files with 22 additions and 8 deletions
|
@ -581,11 +581,14 @@ class Epp::Domain < Domain
|
|||
save(validate: false)
|
||||
end
|
||||
|
||||
### RENEW ###
|
||||
|
||||
def renew(cur_exp_date, period, unit = 'y')
|
||||
@is_renewal = true
|
||||
validate_exp_dates(cur_exp_date)
|
||||
|
||||
add_epp_error('2105', nil, nil, I18n.t('object_is_not_eligible_for_renewal')) unless renewable?
|
||||
add_renew_epp_errors unless renewable?
|
||||
|
||||
return false if errors.any?
|
||||
|
||||
period = period.to_i
|
||||
|
@ -613,6 +616,13 @@ class Epp::Domain < Domain
|
|||
save
|
||||
end
|
||||
|
||||
def add_renew_epp_errors
|
||||
if renew_blocking_statuses.any? && !renewable?
|
||||
add_epp_error('2304', 'status', renew_blocking_statuses,
|
||||
I18n.t('object_status_prohibits_operation'))
|
||||
end
|
||||
end
|
||||
|
||||
### TRANSFER ###
|
||||
|
||||
def transfer(frame, action, current_user)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue