mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 01:36:02 +02:00
Add registry lock operation to epp notification
This commit is contained in:
parent
0bc86229e2
commit
7638bff546
2 changed files with 20 additions and 6 deletions
|
@ -25,6 +25,10 @@ class Notification < ApplicationRecord
|
||||||
''
|
''
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def registry_lock?
|
||||||
|
text.include?('has been locked') || text.include?('has been unlocked')
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_defaults
|
def set_defaults
|
||||||
|
|
|
@ -15,12 +15,22 @@ xml.epp_head do
|
||||||
end if @object
|
end if @object
|
||||||
end
|
end
|
||||||
|
|
||||||
if @notification.action&.contact
|
if @notification.action&.contact || @notification.registry_lock?
|
||||||
render(partial: 'epp/poll/action',
|
if @notification.registry_lock?
|
||||||
locals: {
|
state = @notification.text.include?('unlocked') ? 'unlock' : 'lock'
|
||||||
builder: xml,
|
xml.extension do
|
||||||
action: @notification.action
|
xml.tag!('changePoll:changeData',
|
||||||
})
|
'xmlns:changePoll': 'https://epp.tld.ee/schema/changePoll-1.0.xsd') do
|
||||||
|
xml.tag!('changePoll:operation', state)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
render(partial: 'epp/poll/action',
|
||||||
|
locals: {
|
||||||
|
builder: xml,
|
||||||
|
action: @notification.action,
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
render('epp/shared/trID', builder: xml)
|
render('epp/shared/trID', builder: xml)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue