mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
110687814-update_function
This commit is contained in:
parent
89292bea53
commit
185e1d5c93
1 changed files with 10 additions and 1 deletions
|
@ -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? &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue