Repp: Contact create: validate identifier

This commit is contained in:
Karl Erik Õunapuu 2020-10-07 12:46:19 +03:00
parent d4628d52ba
commit 01004b8ed4
No known key found for this signature in database
GPG key ID: C9DD647298A34764
5 changed files with 67 additions and 19 deletions

View file

@ -30,12 +30,13 @@ class Epp::Contact < Contact
at
end
def new(frame, registrar)
def new(frame, registrar, epp: true)
return super if frame.blank?
attrs = epp ? attrs_from(frame, new_record: true) : frame
super(
attrs_from(frame, new_record: true).merge(
code: frame.css('id').text,
attrs.merge(
code: epp ? frame.css('id').text : frame[:id],
registrar: registrar
)
)