mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Story#105747240 - remove legal documents from domain history
This commit is contained in:
parent
a6027ac7d6
commit
b05ce36ea3
2 changed files with 9 additions and 8 deletions
|
@ -51,10 +51,6 @@ class Epp::DomainsController < EppController
|
|||
authorize! :update, @domain, @password
|
||||
begin
|
||||
if @domain.update(params[:parsed_frame], current_user)
|
||||
|
||||
@domain.attach_legal_document(Epp::Domain.parse_legal_document_from_frame(params[:parsed_frame]))
|
||||
@domain.save(validate: false)
|
||||
|
||||
if @domain.epp_pending_update.present?
|
||||
render_epp_response '/epp/domains/success_pending'
|
||||
else
|
||||
|
@ -75,9 +71,6 @@ class Epp::DomainsController < EppController
|
|||
|
||||
handle_errors(@domain) and return unless @domain.can_be_deleted?
|
||||
|
||||
@domain.attach_legal_document(Epp::Domain.parse_legal_document_from_frame(params[:parsed_frame]))
|
||||
@domain.save(validate: false)
|
||||
|
||||
if @domain.epp_destroy(params[:parsed_frame], current_user.id)
|
||||
if @domain.epp_pending_delete.present?
|
||||
render_epp_response '/epp/domains/success_pending'
|
||||
|
|
|
@ -439,6 +439,10 @@ class Epp::Domain < Domain
|
|||
at.deep_merge!(attrs_from(frame.css('chg'), current_user, 'chg'))
|
||||
at.deep_merge!(attrs_from(frame.css('rem'), current_user, 'rem'))
|
||||
|
||||
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
end
|
||||
|
||||
at_add = attrs_from(frame.css('add'), current_user)
|
||||
at[:nameservers_attributes] += at_add[:nameservers_attributes]
|
||||
|
||||
|
@ -503,7 +507,7 @@ class Epp::Domain < Domain
|
|||
def attach_legal_document(legal_document_data)
|
||||
return unless legal_document_data
|
||||
|
||||
legal_documents.build(
|
||||
legal_documents.create(
|
||||
document_type: legal_document_data[:type],
|
||||
body: legal_document_data[:body]
|
||||
)
|
||||
|
@ -512,6 +516,10 @@ class Epp::Domain < Domain
|
|||
def epp_destroy(frame, user_id)
|
||||
return false unless valid?
|
||||
|
||||
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
end
|
||||
|
||||
if Setting.request_confirmation_on_domain_deletion_enabled &&
|
||||
frame.css('delete').children.css('delete').attr('verified').to_s.downcase != 'yes'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue