Forbid cancelling force delete procedure when a domain is discarded

This commit is contained in:
Artur Beljajev 2018-07-29 20:42:29 +03:00
parent 024a993547
commit cc36e3ccea
5 changed files with 22 additions and 16 deletions

View file

@ -16,7 +16,9 @@ module Concerns::Domain::ForceDelete
end
def cancel_force_delete
raise 'Domain must be discarded before cancelling force delete procedure' unless discarded?
if discarded?
raise StandardError, 'Force delete procedure cannot be cancelled while a domain is discarded'
end
restore_statuses_before_force_delete
remove_force_delete_statuses