110687814-update_function

This commit is contained in:
Stas 2016-02-10 10:38:47 +02:00
parent 89292bea53
commit 185e1d5c93

View file

@ -3,9 +3,11 @@ class Epp::Domain < Domain
include EppErrors
# TODO: remove this spagetti once data in production is correct.
attr_accessor :is_renewal, :is_transfer
attr_accessor :is_renewal, :is_transfer, :current_user
before_validation :manage_permissions
before_update :write_update_values
def manage_permissions
return if is_admin # this bad hack for 109086524, refactor later
return true if is_transfer || is_renewal
@ -14,6 +16,11 @@ class Epp::Domain < Domain
false
end
def write_update_values
self.updator_str = current_user.identity_code if current_user
self.updated_at = Time.zone.now
end
after_validation :validate_contacts
def validate_contacts
return true if is_renewal || is_transfer
@ -488,6 +495,8 @@ class Epp::Domain < Domain
# at[:statuses] += at_add[:domain_statuses_attributes]
@current_user = current_user
if errors.empty? && verify &&
Setting.request_confrimation_on_registrant_change_enabled &&
frame.css('registrant').present? &&