fixed codeclimate errors

This commit is contained in:
dinsmol 2021-09-09 13:06:51 +03:00
parent f4e0084895
commit e7e3278267
44 changed files with 118 additions and 150 deletions

View file

@ -98,8 +98,8 @@ class Epp::Contact < Contact
return unless legal_document_data
legal_documents.create(
document_type: legal_document_data[:type],
body: legal_document_data[:body]
document_type: legal_document_data[:type],
body: legal_document_data[:body]
)
end
@ -108,9 +108,9 @@ class Epp::Contact < Contact
return unless legal_document_data
doc = LegalDocument.create(
documentable_type: Contact,
document_type: legal_document_data[:type],
body: legal_document_data[:body]
documentable_type: Contact,
document_type: legal_document_data[:type],
body: legal_document_data[:body]
)
self.legal_documents = [doc]

View file

@ -144,8 +144,8 @@ class Epp::Domain < Domain
return
end
if doc = attach_legal_document(::Deserializers::Xml::LegalDocument.new(frame).call)
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
if doc = attach_legal_document(::Deserializers::Xml::LegalDocument.new(frame).call) && doc&.persisted?
frame.css("legalDocument").first.content = doc.path
end
if Setting.request_confirmation_on_domain_deletion_enabled &&
@ -325,11 +325,13 @@ class Epp::Domain < Domain
return false
end
begin
errors.add(:base, :domain_status_prohibits_operation)
return false
end if (statuses &
if (statuses &
[DomainStatus::CLIENT_DELETE_PROHIBITED, DomainStatus::SERVER_DELETE_PROHIBITED]).any?
begin
errors.add(:base, :domain_status_prohibits_operation)
return false
end
end
true
end