mirror of
https://github.com/internetee/registry.git
synced 2025-07-04 18:23:35 +02:00
Merge branch '111864739-history_legal_doc' into staging
This commit is contained in:
commit
a54fbe906e
1 changed files with 2 additions and 14 deletions
|
@ -151,7 +151,7 @@ class Epp::Contact < Contact
|
||||||
legal_frame = frame.css('legalDocument').first
|
legal_frame = frame.css('legalDocument').first
|
||||||
at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
|
at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
|
||||||
|
|
||||||
if doc = attach_legal_document(parse_legal_document_from_frame(frame))
|
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||||
self.legal_document_id = doc.id
|
self.legal_document_id = doc.id
|
||||||
end
|
end
|
||||||
|
@ -228,7 +228,7 @@ class Epp::Contact < Contact
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_legal_file_to_new frame
|
def add_legal_file_to_new frame
|
||||||
legal_document_data = Epp::Contact.parse_legal_document_from_frame(frame)
|
legal_document_data = Epp::Domain.parse_legal_document_from_frame(frame)
|
||||||
return unless legal_document_data
|
return unless legal_document_data
|
||||||
|
|
||||||
doc = LegalDocument.create(
|
doc = LegalDocument.create(
|
||||||
|
@ -243,16 +243,4 @@ class Epp::Contact < Contact
|
||||||
self.legal_document_id = doc.id
|
self.legal_document_id = doc.id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def parse_legal_document_from_frame frame
|
|
||||||
ld = frame.css('legalDocument').first
|
|
||||||
return nil unless ld
|
|
||||||
return nil if ld.text.starts_with?(ENV['legal_documents_dir'])
|
|
||||||
|
|
||||||
{
|
|
||||||
body: ld.text,
|
|
||||||
type: ld['type']
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue